Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I did some investigation and found the cause of error is I had installed multiple version of SharePoint online csom. After unistalling older version, I succeeded to execute your code and got to add list column to content type. Thank you very much!
Thank you for quick response. I tried your script, but got same exception. Exception setting "Field": "Cannot convert the "Microsoft.SharePoint.Client.FieldText" value of type "Microsoft.SharePoint.Client.FieldText" to type "Microsoft.SharePoint.Client.Field"."At D:\tmp\AddContentType.ps1:43 char:1+ $FieldLink.Field = $Column It seems the object type is different between site column and list column, isn't it? Is it possible to cast FieldText type to Field type??