pnp/PnP

Can not create Content Types using PnP Powershell on SharePoint Online since yesterday

Closed this issue · 3 comments

Category

[ ] Bug

Environment

[ ] Office 365 / SharePoint Online

Observed Behavior

I am used to apply the exact same PnP Schema to add Site Content Types to my Site Collection using PnP Powershell (version 3.9.1905.0).
Here is the Error I am getting since yesterday :

PS C:\Users\KIKI\Desktop\MSF\Scripts> C:\Users\KIKI\Desktop\MSF\Scripts\CList.ps1
Apply-PnPProvisioningTemplate : Value cannot be null.
Parameter name: s
Au caractère C:\Users\KIKI\Desktop\MSF\Scripts\CList.ps1:5 : 1

  • Apply-PnPProvisioningTemplate -Path KMS_CList.xml -ResourceFolder ".\ ...
  •   + CategoryInfo          : WriteError: (:) [Apply-PnPProvisioningTemplate], ServerException
      + FullyQualifiedErrorId : EXCEPTION,SharePointPnP.PowerShell.Commands.Provisioning.Site.ApplyProvisioningTemplate
    
    
    
    
    
    
    

Steps to Reproduce

here is a part of my Xml Template :

<pnp:SiteFields> <Field Type="Text" DisplayName="{resource:FieldOne}" Required="FALSE" EnforceUniqueValues="FALSE" Indexed="FALSE" MaxLength="255" ID="{e4636e15-1dcf-4a6a-a877-c10afd290ca2}" SourceID="{{listid:MyList}}" StaticName="FieldOne" Name="FieldOne" ColName="nvarchar4" RowOrdinal="0" Group="My Custom PNP Fields" /> <Field Type="Text" DisplayName="{resource:FieldTwo}" Required="FALSE" EnforceUniqueValues="FALSE" Indexed="FALSE" MaxLength="255" ID="{696ea8fe-a542-4d42-b0ea-4a19dee948d1}" SourceID="{{listid:MyList}}" StaticName="FieldTwo" Name="FieldTwo" ColName="nvarchar5" RowOrdinal="0" Group="My Custom PNP Fields" /> <Field Type="Text" DisplayName="{resource:FieldThree}" Required="FALSE" EnforceUniqueValues="FALSE" Indexed="FALSE" MaxLength="255" ID="{f5979413-809c-45d4-9516-bba2e7d992d9}" SourceID="{{listid:MyList}}" StaticName="FieldThree" Name="FieldThree" ColName="nvarchar6" RowOrdinal="0" Group="My Custom PNP Fields" /> </pnp:SiteFields>

<pnp:ContentTypes> <pnp:ContentType ID="0x010500C562BA980E1C457B97298CA27EC2C843" Name="MyCustomContentType" Description="Test Description" Group="Custom Group"> <pnp:FieldRefs> <pnp:FieldRef ID="fa564e0f-0c70-4ab9-b863-0177e6ddd247" Name="Title" Hidden="true" /> <pnp:FieldRef ID="e4636e15-1dcf-4a6a-a877-c10afd290ca2" Name="FieldOne" /> <pnp:FieldRef ID="696ea8fe-a542-4d42-b0ea-4a19dee948d1" Name="FieldTwo" /> <pnp:FieldRef ID="f5979413-809c-45d4-9516-bba2e7d992d9" Name="FieldThree" /> </pnp:FieldRefs> </pnp:ContentType>

I am very confused since this always works. Is there any changes regarding the SharePoint Online Rest Api Recently ?

Is There any fix for my issue ?

Regards,

Arioule

We are having the same issue. Our provisioning XML has stopped working and we've discovered this issue yesterday.

Hi ikmoss,

A new version of PNP powershell has been released to fix the problem.
https://www.powershellgallery.com/packages/SharePointPnPPowerShellOnline/3.9.1905.1

ref : SharePoint/sp-dev-docs#3947

Thanks for the updated Arioule. We have recreated our template with 2019-03 schema and the problem was resolved.

Cheers, Ian