I am try to programatically add a library webpart to page. I've tried the below code with no luck

Occasional Visitor

Add-PnPClientSideWebPart -Page $page -DefaultWebPartType Library -WebPartProperties @{"selectedListID" = "0feb0257-f487-4c19-a8b0-9cf40f240222"}

 

Any help would be appreciated.

Pweetster

1 Reply
-DefaultWebPartType List. It works for libraries too. You can add "isDocumentLibrary":true to the WebPartProperties parameter, but I don't think it's necessary.