Function Add-PnPContenTypeToList
Can someone help me with this problem? I am using for several months a function to add a content type to a document library.
Add-PnPContentTypeToList -List $listName -ContentType $ContentTypeName -DefaultContentType
This has been working without a problem until last month. On every site created in august or later I get an error. On site collections created before august I don't get the error.
Expected behavior
The existent content type is added to the document library or list.
Actual behavior
Error : The formule contains a syntax error or is not supported --> only in the new site collections created in august or later. In site collections created before august, I don't have this problem and I can keep using this code. I call the same function and get only an error in the new site collections.
Steps to reproduce behavior
Add-PnPContentTypeToList -List $listName -ContentType $ContentTypeName -DefaultContentType
Which version of the PnP-PowerShell Cmdlets are you using?
- [ ] PnP PowerShell for SharePoint 2013
- [ ] PnP PowerShell for SharePoint 2016
- [X] PnP PowerShell for SharePoint Online
What is the version of the Cmdlet module you are running?
3.12.19
How did you install the PnP-PowerShell Cmdlets?
- [ ] MSI Installed downloaded from GitHub
- [X] Installed through the PowerShell Gallery with Install-Module
- [ ] Other means
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
I had a similar issue, found one of the columns the Content Type was using had bad validation - I would create a new SP List and try adding each column form the Content Type manually until it shows the error and check the column.
thx. It was the formula in a site column for default value that gives the error. Because it kept working on older sites I didn't check this. And in SharePoint UI it still works.
I guess it is caused by the different way of creating the new site collections. The new ones are created with language English and afterwards put in Dutch.
The solution is that I create via powershell a site column without formula, I create the content type and the library's. Afterwards I put the formula in the site column manually in SPO.