Sharepoint-PNP - Is there a way to use PNP to update only one specific library?

%3CLINGO-SUB%20id%3D%22lingo-sub-1075538%22%20slang%3D%22en-US%22%3ESharepoint-PNP%20-%20Is%20there%20a%20way%20to%20use%20PNP%20to%20update%20only%20one%20specific%20library%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1075538%22%20slang%3D%22en-US%22%3E%3CP%3EI've%20managed%20to%20download%20a%20site%20template%20and%20make%20a%20new%20site%20based%20on%20this%20template%2C%20however%20the%20only%20thing%20i%20want%20updated%20is%20one%20specific%20document%20library.%20Is%20there%20a%20way%20to%20achieve%20this%20with%20PNP%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1075538%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1075863%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint-PNP%20-%20Is%20there%20a%20way%20to%20use%20PNP%20to%20update%20only%20one%20specific%20library%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1075863%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F279068%22%20target%3D%22_blank%22%3E%40FrodeH%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWith%20PnP%20Provisioning%20templates%20and%20PNP%20PowerShell%20you%20can%20update%20just%20a%20single%20library.%20If%20you%20have%20the%20template%20xml%2C%20you%20can%20just%20clean%20out%20other%20elements%20and%20leave%20only%20the%20list%20instance%20element%20for%20the%20list%20you%20want%20to%20be%20updated.%3C%2FP%3E%3CP%3EIf%20you%20only%20want%20to%20export%20list%20instances%2C%20it%20is%20possible%20with%20-Handlers%20option%20like%20this%3A%3CBR%20%2F%3EGet-PnPProvisioningTemplate%20-Handlers%20Lists%20-Out%20%3CFILENAME%3E%3C%2FFILENAME%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1075960%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint-PNP%20-%20Is%20there%20a%20way%20to%20use%20PNP%20to%20update%20only%20one%20specific%20library%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1075960%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F5628%22%20target%3D%22_blank%22%3E%40Matti%20Paukkonen%3C%2FA%3E%26nbsp%3Bthat%20is%20excellent!%20Can%20i%20also%20somehow%20specify%20a%20specific%20list%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1076847%22%20slang%3D%22en-US%22%3ERe%3A%20Sharepoint-PNP%20-%20Is%20there%20a%20way%20to%20use%20PNP%20to%20update%20only%20one%20specific%20library%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1076847%22%20slang%3D%22en-US%22%3E%3CP%3EHey%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F279068%22%20target%3D%22_blank%22%3E%40FrodeH%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20totally%20target%20a%20specififc%20list%20to%20generate%20a%20template%20from%2C%20using%20the%20%22%3CSPAN%20class%3D%22hljs-parameter%22%3EListsToExtract%3C%2FSPAN%3E%22%20parameter%26nbsp%3B%20in%20the%26nbsp%3B%3CSPAN%3EGet-PnPProvisioningTemplate%20command.%20You%20can%26nbsp%3B%3C%2FSPAN%3Echeckout%26nbsp%3Bthe%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fsharepoint-pnp%2Fget-pnpprovisioningtemplate%3Fview%3Dsharepoint-ps%23examples%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Edocumentation%3C%2FA%3E%20for%20more%20info%2C%20or%20let%20us%20know%20if%20you%20have%20any%20question.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

I've managed to download a site template and make a new site based on this template, however the only thing i want updated is one specific document library. Is there a way to achieve this with PNP?

3 Replies

@FrodeH,

 

With PnP Provisioning templates and PNP PowerShell you can update just a single library. If you have the template xml, you can just clean out other elements and leave only the list instance element for the list you want to be updated.

If you only want to export list instances, it is possible with -Handlers option like this:
Get-PnPProvisioningTemplate -Handlers Lists -Out <filename>

@Matti Paukkonen that is excellent! Can i also somehow specify a specific list?

Hey @FrodeH ,

 

You can totally target a specififc list to generate a template from, using the "ListsToExtract" parameter  in the Get-PnPProvisioningTemplate command. You can checkout the documentation for more info, or let us know if you have any question.

 

Regards