Forum Discussion
Niclas Carlsson
Feb 13, 2017Brass Contributor
PnP PowerShell - PnP Provisioning package (pnp) with folders
Hi Is it possible to create a pnp provisioning file with a folder structure for a library by using Convert-PnPFolderToProvisioningTemplate or doesn't the current provisioning enging support pnp ...
Nigel Price
Feb 19, 2017Iron Contributor
Hi Paul
What would the provisioning Template entries look like to support the folder hierarchy?
Regards
Nigel
Deleted
Feb 20, 2017hi Nigel,
in my code i did a big one this is a extract of the template:
<def:ListConfiguration xmlns:def="http://tempuri.org/ListConfiguration"> <def:SiteUrl>{parameter:SiteCollectionUrl}</def:SiteUrl> <def:Lists> <def:List Url="COM"> <def:Folders> <def:Folder Title="Estimates"> <def:ObjectSecurity> <def:BreakRoleInheritance ClearSubscopes="false" CopyRoleAssignments="true"> <def:RoleAssignment Principal="Estimators" RoleDefinition="ContributeWithoutDelete"/> </def:BreakRoleInheritance> </def:ObjectSecurity> </def:Folder> </def:Folders> </def:List> </def:Lists> </def:ListConfiguration>
- Nigel PriceFeb 22, 2017Iron Contributor
Hi Paul
@ErwinVanHunen's Blog says this is the call you make for the extension ->
public void ProcessRequest(ClientContext ctx, ProvisioningTemplate template, string configurationData)
Your code has this ->
private void CreateFolders(ClientContext context, Web web, List list, Project.Provisioning.Models.ListConfigurationListFolder[] folders)
So I presume I have to convert between the two.
I can get web from the clientcontext but for the list I need to have the list name. Where do I get that from ?
Thanks
Nigel - Nigel PriceFeb 20, 2017Iron Contributor
Thanks Paul - very interesting - I will have to give it a go. I have been looking to be able to this for a while. Should there not be something in the pnp provisioning template which links your <def:... to your code ?