New answers tagged

0

So, as mentioned in the comments, first I tried just immediately getting a new reference to each SPList by doing: SPList list = web.GetList(usage.Url); SPList newList = web.Lists[list.ID]; SPContentType listLevelCType = newList.ContentTypes[newCType.Name]; if (listLevelCType == null) { listLevelCType = newList.ContentTypes.Add(newCType); } But that did ...


0

If anyone stumbles across this looking to simply change the content type template to an existing file - without uploading a document. You can do this more simply $MyContentType = get-pnpcontenttype -List "My Document Library" -Identity "My Content Type" $MyContentType.DocumentTemplate = "New Template.docx" $MyContentType.Update($...


0

This is an expected behavior in SharePoint. If you are using the content type in a list, you cannot delete it directly from site. First you have to remove the site content type from all lists & then you can delete it from site settings --> Site content types. Alternatively, you can hide the content type from list instead of deleting it. Follow below ...


0

PnP PowerShell to Delete Content Type in SharePoint Online: #Config Variables $SiteURL = "https://crescenttech.sharepoint.com" $ContentTypeName ="Project Proposal V1" #Connect to PNP Online Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential) #Get the content type $ContentType = Get-PnPContentType -Identity $ContentTypeName If(...


0

This is by design, often to discourage the use of classic features or due to potential security issues with scripting. You can run this on the site: Set-SPOSite -DenyAddAndCustomizePages:$false That will allow you to leverage these features.


Top 50 recent answers are included