Open ruslanurban opened 6 years ago
Interesting idea. you can however do something similar in the following way, it's maybe a bit more elaborate, but it has the same effect.
Add-PnPFileToProvisioningTemplate -Path $templatePath -Container "Files\_catalogs\masterpage" -Source '.\_catalogs\masterpage\corporate.html' -Folder "{site}/_catalogs/masterpage" -FileLevel Published
$template = Load-PnPProvisioningTemplate -Path $templatePath
# Here we add properties to the first file element in the template
$template.Files[0].Properties.Add("ContentTypeId","{contenttypeid:Html Master Page}")
$template.Files[0].Properties.Add("Title","Master Page with Corporate Branding")
$template.Files[0].Properties.Add("HtmlDesignFromMaster","{masterpagecatalog}/corporate.html, {masterpagecatalog}/corporate.html")
$template.Files[0].Properties.Add("HtmlDesignAssociated","True")
Apply-PnPProvisioningTemplate -InputInstance $template
Thank you for the sample Ervin. Hope to see the enhancement implemented in the framework because the functionality is implied by the schema.
Missing Feature | Enhancement
PnP Scheme allows specifying a list of parameters for
pnp:File
elements. It woudl be great to extend theAdd-PnPFileToProvisioningTemplate
cmdlet with a parameter[System.Collections.IDictionary] Properties
(See https://github.com/SharePoint/PnP-Provisioning-Schema/blob/master/ProvisioningSchema-2018-01.md#file).Similarly, add ability to define
pnp:WebParts
andpnp:Security
definitions on the generatedpnp:File
elements.Expected behavior
Example:
The template shall contain the following File entry.
Actual behavior
N/A
How did you install the PnP-PowerShell Cmdlets?
Which version of the PnP-PowerShell Cmdlets are you using?