I am adding a content type to a library using powershell. But it is throwing me this error:
Exception calling "Add" with "1" argument(s): "Field name already exists. The name used for this field is already used by another field in the list. Select another name and try again." At c:\Add-ContentType.ps1:47 char:29 + $ctAdded = $spList.ContentTypes.Add($newContentType) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) , MethodInvocationException + FullyQualifiedErrorId : SPException
I am running the script on SharePoint 2016.
Edit: I created a new content type based on Document Set via the browser. I did not add any fields in it. The only fields available are the ones out of the box, Title and Description. Even that threw the error.
Anyone has got any idea?