external help file | applicable | schema |
---|---|---|
SharePoint Server 2013, SharePoint Server 2016, SharePoint Online |
2.0.0 |
Applies a provisioning template to a web
Apply-PnPProvisioningTemplate [-InputInstance <ProvisioningTemplate>]
[-ResourceFolder <String>]
[-OverwriteSystemPropertyBagValues [<SwitchParameter>]]
[-IgnoreDuplicateDataRowErrors [<SwitchParameter>]]
[-ProvisionContentTypesToSubWebs [<SwitchParameter>]]
[-ClearNavigation [<SwitchParameter>]]
[-Parameters <Hashtable>]
[-Handlers <Handlers>]
[-ExcludeHandlers <Handlers>]
[-ExtensibilityHandlers <ExtensibilityHandler[]>]
[-TemplateProviderExtensions <ITemplateProviderExtension[]>]
[-Web <WebPipeBind>]
[-Connection <SPOnlineConnection>]
Apply-PnPProvisioningTemplate [-GalleryTemplateId <Guid>]
[-ResourceFolder <String>]
[-OverwriteSystemPropertyBagValues [<SwitchParameter>]]
[-IgnoreDuplicateDataRowErrors [<SwitchParameter>]]
[-ProvisionContentTypesToSubWebs [<SwitchParameter>]]
[-ClearNavigation [<SwitchParameter>]]
[-Parameters <Hashtable>]
[-Handlers <Handlers>]
[-ExcludeHandlers <Handlers>]
[-ExtensibilityHandlers <ExtensibilityHandler[]>]
[-TemplateProviderExtensions <ITemplateProviderExtension[]>]
[-Web <WebPipeBind>]
[-Connection <SPOnlineConnection>]
Apply-PnPProvisioningTemplate -Path <String>
[-ResourceFolder <String>]
[-OverwriteSystemPropertyBagValues [<SwitchParameter>]]
[-IgnoreDuplicateDataRowErrors [<SwitchParameter>]]
[-ProvisionContentTypesToSubWebs [<SwitchParameter>]]
[-ClearNavigation [<SwitchParameter>]]
[-Parameters <Hashtable>]
[-Handlers <Handlers>]
[-ExcludeHandlers <Handlers>]
[-ExtensibilityHandlers <ExtensibilityHandler[]>]
[-TemplateProviderExtensions <ITemplateProviderExtension[]>]
[-Web <WebPipeBind>]
[-Connection <SPOnlineConnection>]
PS:> Apply-PnPProvisioningTemplate -Path template.xml
Applies a provisioning template in XML format to the current web.
PS:> Apply-PnPProvisioningTemplate -Path template.xml -ResourceFolder c:\provisioning\resources
Applies a provisioning template in XML format to the current web. Any resources like files that are referenced in the template will be retrieved from the folder as specified with the ResourceFolder parameter.
PS:> Apply-PnPProvisioningTemplate -Path template.xml -Parameters @{"ListTitle"="Projects";"parameter2"="a second value"}
Applies a provisioning template in XML format to the current web. It will populate the parameter in the template the values as specified and in the template you can refer to those values with the {parameter:} token.
For instance with the example above, specifying {parameter:ListTitle} in your template will translate to 'Projects' when applying the template. These tokens can be used in most string values in a template.
PS:> Apply-PnPProvisioningTemplate -Path template.xml -Handlers Lists, SiteSecurity
Applies a provisioning template in XML format to the current web. It will only apply the lists and site security part of the template.
PS:> Apply-PnPProvisioningTemplate -Path template.pnp
Applies a provisioning template from a pnp package to the current web.
PS:> Apply-PnPProvisioningTemplate -Path https://tenant.sharepoint.com/sites/templatestorage/Documents/template.pnp
Applies a provisioning template from a pnp package stored in a library to the current web.
PS:> $handler1 = New-PnPExtensibilityHandlerObject -Assembly Contoso.Core.Handlers -Type Contoso.Core.Handlers.MyExtensibilityHandler1
PS:> $handler2 = New-PnPExtensibilityHandlerObject -Assembly Contoso.Core.Handlers -Type Contoso.Core.Handlers.MyExtensibilityHandler1
PS:> Apply-PnPProvisioningTemplate -Path NewTemplate.xml -ExtensibilityHandlers $handler1,$handler2
This will create two new ExtensibilityHandler objects that are run while provisioning the template
PS:> Apply-PnPProvisioningTemplate -Path .\ -InputInstance $template
Applies a provisioning template from an in-memory instance of a ProvisioningTemplate type of the PnP Core Component, reading the supporting files, if any, from the current (.) path. The syntax can be used together with any other supported parameters.
Override the RemoveExistingNodes attribute in the Navigation elements of the template. If you specify this value the navigation nodes will always be removed before adding the nodes in the template
Type: SwitchParameter
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
Allows you to run all handlers, excluding the ones specified.
Type: Handlers
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
Allows you to specify ExtensbilityHandlers to execute while applying a template
Type: ExtensibilityHandler[]
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
Type: Guid
Parameter Sets: Gallery
Required: False
Position: Named
Accept pipeline input: False
Allows you to only process a specific part of the template. Notice that this might fail, as some of the handlers require other artifacts in place if they are not part of what your applying.
Type: Handlers
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
Ignore duplicate data row errors when the data row in the template already exists.
Type: SwitchParameter
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
Allows you to provide an in-memory instance of the ProvisioningTemplate type of the PnP Core Component. When using this parameter, the -Path parameter refers to the path of any supporting file for the template.
Type: ProvisioningTemplate
Parameter Sets: Instance
Required: False
Position: Named
Accept pipeline input: False
Specify this parameter if you want to overwrite and/or create properties that are known to be system entries (starting with vti_, dlc_, etc.)
Type: SwitchParameter
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
Allows you to specify parameters that can be referred to in the template by means of the {parameter:} token. See examples on how to use this parameter.
Type: Hashtable
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
Path to the xml or pnp file containing the provisioning template.
Type: String
Parameter Sets: Path
Required: True
Position: 0
Accept pipeline input: True
If set content types will be provisioned if the target web is a subweb.
Type: SwitchParameter
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
Root folder where resources/files that are being referenced in the template are located. If not specified the same folder as where the provisioning template is located will be used.
Type: String
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
Allows you to specify ITemplateProviderExtension to execute while applying a template.
Type: ITemplateProviderExtension[]
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
Optional connection to be used by cmdlet. Retrieve the value for this parameter by eiter specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.
Type: SPOnlineConnection
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.
Type: WebPipeBind
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False