Forum Discussion
Jeremy GOUPIL
Aug 24, 2018Copper Contributor
Apply-PnPProvisioningTemplate : File not Found
Hello, I have a problem using Apply-PnPProvisioningTemplate with PowerShell on a SharePoint Online context. #website created to be used as a template Connect-PnPOnline -Url "https://$principalWe...
- AnonymousSep 17, 2018I've found the lines causing the Error:
After each List Instance, there is a Field "_DisplayName" that gets updated: the .xml looks like this:
<pnp:Fields>
<Field ID="{1a53ab5a-11f9-4b92-a377-8cfaaf6ba7be}" Name="_DisplayName" DisplaceOnUpgrade="TRUE" Sortable="FALSE" Filterable="FALSE" Hidden="FALSE" ReadOnly="TRUE" ShowInFileDlg="FALSE" Type="Lookup" DisplayName="Sensitivity" List="Docs" ListInternal="IpLabelCache" FieldRef="LabelId" ShowField="DisplayName" LeftList="Docs" LeftColumnName="IpLabelId" JoinColName="LabelId" JoinRowOrdinal="0" JoinType="LEFT OUTER" SchemaVersion="16.0.162.0" RecreateIfMissing="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="_DisplayName" FromBaseType="TRUE" />
</pnp:Fields>
I removed this Field Updates and was able to apply my template as I wanted. This bug seems to have been reported already (And fixes but not merged yet): https://github.com/SharePoint/PnP-Sites-Core/pull/1911
Tom Castiglia
Sep 17, 2018Iron Contributor
Hello Jeremy GOUPIL - Looking at your Powershell code, are you setting a value for the $modelePath variable used for the Apply-PnPProvisioningTemplate?
Jeremy GOUPIL
Sep 24, 2018Copper Contributor
Hi, yes, it is the same $path than the one used to export the template at the beginning.
I can see that SharePoint is reading and uploading things in lists but at one moment, it crashes.
- AnonymousSep 24, 2018Hi Jeremy,
There is a bug in the provisioning schema causing this error. try to find the field Name="_DisplayName" within your template.xml (there are multiple of them) are remove those fieds ;)
Check out my post a bit up in the thread for more Infos