I was hoping if someone has created a OneNote notebook file from Power Shell command and stored it in a document library in SharePoint Online. We can create sections and page of OneNote file from Power-Shell and graph API but I couldn't achieve creating a complete new notebook, so if anyone can help me with power shell commands and graph API in creating one and storing it in desired SharePoint library

Thanks in advance.


You could try the below powershell:

$ctx = Get-PnPContext
$folder=Add-PnPFolder -Name "testOneNote" -Folder "Shared Documents"
$folder.ListItemAllFields["HTML_x0020_File_x0020_Type"] = "OneNote.Notebook"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.