Get-PnPProvisioningTemplate and Communication Sites

%3CLINGO-SUB%20id%3D%22lingo-sub-133400%22%20slang%3D%22en-US%22%3EGet-PnPProvisioningTemplate%20and%20Communication%20Sites%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-133400%22%20slang%3D%22en-US%22%3E%3CP%3EI%20understand%20that%20the%20output%20of%20Get-PnPProvisioningTemplate%20is%20based%20on%20a%20delta%20between%20the%20site%20you%20are%20pointing%20it%20at%20and%20a%20default%20%22plain-vanilla%22%20site%2C%20but%20when%20I%20try%20to%20create%20a%20new%20XML%20template%20from%20a%20Communication%20site%20(specifying%20I%20only%20want%20Fields%20and%20ContentTypes%20using%20the%20-Handlers%20parameter)%2C%20I%20end%20up%20with%20an%20ENORMOUS%20.xml%20file%20with%20many%20more%20fields%20and%20content%20types%20than%20the%20ones%20I%20created%20myself.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFrom%20the%20results%2C%20it%20looks%20like%20the%20cmdlet%20is%20grabbing%20everything%20in%20the%20Communication%20site%20that%20does%20not%20match%20the%20base%20site%20template%20of%20STS%230.%26nbsp%3B%20Communication%20sites%20have%20a%20base%20site%20template%20of%26nbsp%3B%3C%2FP%3E%0A%3CDIV%3E%0A%3CDIV%3E%3CSPAN%3ESITEPAGEPUBLISHING%230.%26nbsp%3B%20Is%20there%20any%20way%20to%20tell%20the%20cmdlet%20to%20compare%20against%20that%20base%20site%20template%20so%20that%20what%20gets%20put%20into%20the%20XML%20template%20is%20only%20the%20things%20that%20I%20have%20added%20or%20changed%3F%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3EThanks.%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-134041%22%20slang%3D%22en-US%22%3ERe%3A%20Get-PnPProvisioningTemplate%20and%20Communication%20Sites%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-134041%22%20slang%3D%22en-US%22%3E%3CBLOCKQUOTE%3E%3CHR%20%2F%3E%40Deleted%20wrote%3A%3CBR%20%2F%3E%3CP%3EBy%20Default%20the%20latest%20versions%20only%20export%20what%20you%20added%20or%20changed.%3C%2FP%3E%0A%3CHR%20%2F%3E%3C%2FBLOCKQUOTE%3E%0A%3CP%3EOnly%20when%20the%20base%26nbsp%3Bsite%20template%20type%20is%20STS%230%20(classic%20team%20site).%26nbsp%3B%20When%20I%20go%20against%20a%20new%20(%22modern%22)%20communication%20site%2C%20I%20get%20the%20delta%20between%20one%20of%20those%20and%20a%20classic%20team%20site.%20What%20I%20want%20is%20to%20get%20the%20delta%20between%20an%20unaltered%20communication%20site%20and%20a%20communication%20site%20where%20I%20have%20made%20changes.%26nbsp%3B%20In%20order%20to%20do%20that%2C%20I%20need%20the%20PnP%20PowerShell%20cmdlet%20to%20know%20what%20base%20site%20template%20to%20compare%20against.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-134037%22%20slang%3D%22en-US%22%3ERe%3A%20Get-PnPProvisioningTemplate%20and%20Communication%20Sites%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-134037%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F9907%22%20target%3D%22_blank%22%3E%40Joel%20Rodrigues%3C%2FA%3E%2C%20thanks%2C%20I%20did%20look%20at%20that%20but%20it%20still%20gives%20me%20the%20entire%20group%20when%20perhaps%20I%20only%20changed%20one%20content%20type%20in%20the%20group...%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAlso%2C%20this%20does%20nothing%20for%20anything%20other%20than%20content%20types.%26nbsp%3B%20I%20still%20get%20a%20bunch%20of%20fields%2C%20etc...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-133660%22%20slang%3D%22en-US%22%3ERe%3A%20Get-PnPProvisioningTemplate%20and%20Communication%20Sites%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-133660%22%20slang%3D%22en-US%22%3E%3CP%3EBy%20Default%20the%20latest%20versions%20only%20export%20what%20you%20added%20or%20changed.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-133569%22%20slang%3D%22en-US%22%3ERe%3A%20Get-PnPProvisioningTemplate%20and%20Communication%20Sites%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-133569%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F35575%22%20target%3D%22_blank%22%3E%40Joseph%20Ackerman%3C%2FA%3E%26nbsp%3Bmaybe%20try%20to%20specify%20the%20content%20type%20groups%20that%20you%20want%20to%20export%3F%3C%2FP%3E%0A%3CP%3ECheck%20out%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FSharePoint%2FPnP-PowerShell%2Fblob%2Fmaster%2FDocumentation%2FGet-PnPProvisioningTemplate.md%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Eexample%2012%3C%2FA%3E%26nbsp%3Bfrom%20documentation.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHope%20this%20helps%3C%2FP%3E%0A%3CP%3EJoel%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Contributor

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?
 
Thanks.
4 Replies
Highlighted

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

Check out example 12 from documentation.

 

Hope this helps

Joel

Highlighted

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

Highlighted

@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...

Highlighted

@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.