1

I want to add my document library as a web part to my collection site.

enter image description here

how is that possible using PowerShell, please ?

1 Answer 1

0

Yes, it's possible to add a web part to a page using PnP PowerShel

Example

Add-SPOWebPartToWebPartPage -ServerRelativePageUrl "/Pages/PnPPage.aspx" -Path "D:\PnP\NewWebPart.dwp" -ZoneId "WebPartZone2" -ZoneIndex 0 

Note: you can get the .dwp file by exporting the web part manually, but the document library doesn't have the export option, so try to export it as mentioned at Unable to find the export web part option

Check the details steps,


If you are looking for adding a web part to web part gallery, check Deploy pre-configured web parts to web part gallery

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.