Get-PnPProvisioningTemplate and Communication Sites


I understand that the output of Get-PnPProvisioningTemplate is based on a delta between the site you are pointing it at and a default "plain-vanilla" site, but when I try to create a new XML template from a Communication site (specifying I only want Fields and ContentTypes using the -Handlers parameter), I end up with an ENORMOUS .xml file with many more fields and content types than the ones I created myself.


From the results, it looks like the cmdlet is grabbing everything in the Communication site that does not match the base site template of STS#0.  Communication sites have a base site template of 

SITEPAGEPUBLISHING#0.  Is there any way to tell the cmdlet to compare against that base site template so that what gets put into the XML template is only the things that I have added or changed?
4 Replies

@Joseph Ackerman maybe try to specify the content type groups that you want to export?

Check out example 12 from documentation.


Hope this helps


By Default the latest versions only export what you added or changed.

@Joel Rodrigues, thanks, I did look at that but it still gives me the entire group when perhaps I only changed one content type in the group...


Also, this does nothing for anything other than content types.  I still get a bunch of fields, etc...

@Deleted wrote:

By Default the latest versions only export what you added or changed.

Only when the base site template type is STS#0 (classic team site).  When I go against a new ("modern") communication site, I get the delta between one of those and a classic team site. What I want is to get the delta between an unaltered communication site and a communication site where I have made changes.  In order to do that, I need the PnP PowerShell cmdlet to know what base site template to compare against.