Export-Apply Site Template using PnP Provisioning Engine

Using the new PnP Provisioning Engine, you can model a site by configuring the design of Site Columns, Content Types, List Definitions and Instances, Composed Looks, Pages (either WebPart Pages or Wiki Pages), and much more, via your web browser. When you are done with the design, you can export what you have done into a persistent provisioning template format (XML, JSON, or whatever you like), and you can apply that template to as many target sites as you would like.

Reference Link: https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-engine

Before using the below code you need to run the command in powershell depending on the SharePoint Environment.

For SharePoint Online : Install-Module SharePointPnPPowerShellOnline

The others can be found on : https://github.com/SharePoint/PnP-PowerShell

Below is the code.

Some lines of code are redundant but it was intentionally kept that way, doesn’t me you need to do the same.

Leave a Reply

Your email address will not be published. Required fields are marked *