1

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.

1

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"
$folder.ListItemAllFields.Update()
$ctx.ExecuteQuery() 
| improve this answer | |

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.