DEV Community

Tony Watters
Tony Watters

Posted on

How to export xml scripts from SharePoint Online with PnP PowerShell

Exporting xml script from SharePoint

First create new folder mkdir i.e. demo to house your exported xml.

Next connect to your SharePoint Online site

Connect-PnPOnline -url https://yourtenent.sharepoint.com/sites/mysite
Enter fullscreen mode Exit fullscreen mode

then run the following command to retrieve the pages xml

Get-PnPProvisioningTemplate -out C:\demo\articles.xml
Enter fullscreen mode Exit fullscreen mode

Navigate to view newly created xml file via command

explorer C:\demo\article_xml
Enter fullscreen mode Exit fullscreen mode

when you have updated your xml to your specifications run the following command to apply the edited xml to your selected site i.e. mysite

Apply-PnPProvisioningTemplate -Path C:\demo\articles_xml\
Enter fullscreen mode Exit fullscreen mode

Latest comments (0)