Question

I'm trying to use this PnP PowerShell command: Add-PnPFieldToContentType to assign some site columns to a specific content type. I've connected to the site collection using this command:

Connect-PnPOnline –Url $siteUrl –Credentials ($credential)

and other PnP commands are working just fine, but Add-PnPFieldToContentType throws me this error:

Add-PnPFieldToContentType : Field or property "ShowInDisplayForm" does not exist.
At line:1 char:1
+ Add-PnPFieldToContentType -Field "SPSNumber" -ContentType "East Asia  ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [Add-PnPFieldToContentType], ServerException
    + FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.ContentTypes.AddFieldToContentType

Where "SPSNumber" is the internal name of the column and "East Asia Contact" is the content type name. Here is the command I'm using:

Add-PnPFieldToContentType -Field "SPSWorkFlowName" -ContentType "example content type"

I think I have studied every article on the internet about Add-PnPFieldToContentType and none of them are doing any good.

I appreciate any idea.

Pas de solution correcte

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top