Forum Discussion
Issues in exporting Provisioning template by SharePoint PowerShell PnP
I tried to export the Provisioning template in classic publishing site with Handlers Pages and PageContents but it only exports the Home Page in output file and does not include other pages.
Following is the PowerShell cmdlt I'm tried:
Get-PnPProvisioningTemplate -Web $siteUrl -Out C:\Temp.xml -Handlers Pages, PageContents
Get-PnPProvisioningTemplate -Web $siteUrl -Out C:\Temp.xml -Handlers PageContents
Is there any way i can achieve the same ??
1 Reply
Hi Gagandeep Bhatia,
I had exactly the same problem. Please have a look at the following sample:
https://github.com/SharePoint/PnP-PowerShell/tree/master/Samples/Tenant.Migration
It includes stuff to export multiple pages.
One way to get things working is by adjusting the default page. Then export and set the default page back. The import process is happy to handle multiple pages so you could export the two .xml template files if you wanted to run only a single apply-pnpprovisioningtemplate