external help file | applicable | schema |
---|---|---|
SharePoint Server 2013, SharePoint Server 2016, SharePoint Online |
2.0.0 |
Generates a provisioning template from a given folder, including only files that are present in that folder
New-PnPProvisioningTemplateFromFolder [-Match <String>]
[-ContentType <ContentTypePipeBind>]
[-Properties <Hashtable>]
[-AsIncludeFile [<SwitchParameter>]]
[-Force [<SwitchParameter>]]
[-Encoding <Encoding>]
[-Out <String>]
[-Folder <String>]
[-TargetFolder <String>]
[-Schema <XMLPnPSchemaVersion>]
[-Web <WebPipeBind>]
[-Connection <SPOnlineConnection>]
PS:> New-PnPProvisioningTemplateFromFolder -Out template.xml
Creates an empty provisioning template, and includes all files in the current folder.
PS:> New-PnPProvisioningTemplateFromFolder -Out template.xml -Folder c:\temp
Creates an empty provisioning template, and includes all files in the c:\temp folder.
PS:> New-PnPProvisioningTemplateFromFolder -Out template.xml -Folder c:\temp -Match *.js
Creates an empty provisioning template, and includes all files with a JS extension in the c:\temp folder.
PS:> New-PnPProvisioningTemplateFromFolder -Out template.xml -Folder c:\temp -Match *.js -TargetFolder "Shared Documents"
Creates an empty provisioning template, and includes all files with a JS extension in the c:\temp folder and marks the files in the template to be added to the 'Shared Documents' folder
PS:> New-PnPProvisioningTemplateFromFolder -Out template.xml -Folder c:\temp -Match *.js -TargetFolder "Shared Documents" -ContentType "Test Content Type"
Creates an empty provisioning template, and includes all files with a JS extension in the c:\temp folder and marks the files in the template to be added to the 'Shared Documents' folder. It will add a property to the item for the content type.
PS:> New-PnPProvisioningTemplateFromFolder -Out template.xml -Folder c:\temp -Match *.js -TargetFolder "Shared Documents" -Properties @{"Title" = "Test Title"; "Category"="Test Category"}
Creates an empty provisioning template, and includes all files with a JS extension in the c:\temp folder and marks the files in the template to be added to the 'Shared Documents' folder. It will add the specified properties to the file entries.
PS:> New-PnPProvisioningTemplateFromFolder -Out template.pnp
Creates an empty provisioning template as a pnp package file, and includes all files in the current folder
PS:> New-PnPProvisioningTemplateFromFolder -Out template.pnp -Folder c:\temp
Creates an empty provisioning template as a pnp package file, and includes all files in the c:\temp folder
If specified, the output will only contain the pnp:Files element. This allows the output to be included in another template.
Type: SwitchParameter
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
An optional content type to use.
Type: ContentTypePipeBind
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
The encoding type of the XML file, Unicode is default
Type: Encoding
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
Folder to process. If not specified the current folder will be used.
Type: String
Parameter Sets: (All)
Required: False
Position: 0
Accept pipeline input: False
Overwrites the output file if it exists.
Type: SwitchParameter
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
Optional wildcard pattern to match filenames against. If empty all files will be included.
Type: String
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
Filename to write to, optionally including full path.
Type: String
Parameter Sets: (All)
Required: False
Position: 0
Accept pipeline input: False
Additional properties to set for every file entry in the generated template.
Type: Hashtable
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
The schema of the output to use, defaults to the latest schema
Type: XMLPnPSchemaVersion
Parameter Sets: (All)
Required: False
Position: 1
Accept pipeline input: False
Target folder to provision to files to. If not specified, the current folder name will be used.
Type: String
Parameter Sets: (All)
Required: False
Position: 1
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