문제

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.

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top