SharePoint Online SPOMod: Set-SPOContentType
This article describes a function of a custom SharePoint Online module available for download and installation on GitHub where it welcomes all your suggestions and contributions.
Set-SPOContentType
Updates one or more properties of a content type.
Parameters
ContentTypeID | Mandatory | The ID of the Content Type to be updated |
ListTitle | Optional | Title of the list. To be used ONLY if the content type was created in a list. |
Group | Optional | String. More on the Group property: Content Types: Add Content Types: Edit Content Types: Group Property |
DisplayFormUrl | Optional | String. The display form of the item. More on the property: Content Types: Edit |
EditFormUrl | Optional | String. Gets or sets a value that specifies the URL of a custom new form to use for list items that have been assigned the content type. More on the property: https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.contenttype.newformurl.aspx?f=255&MSPPError=-2147217396 |
Hidden | Optional | Boolean. |
JSLink | Optional | String. |
NewFormUrl | Optional | String. |
ReadOnly | Optional | Boolean. |
Sealed | Optional | Boolean. |
UpdateChildren | Mandatory | Boolean. |
Examples
----- EXAMPLE 1 ------
Fix the forms. If your forms Edit.aspx, Display.aspx or New.aspx are throwing an error, you can reset them by writing:
Set-SPOContentType -ContentTypeID 0x005EA3C6CA1B82D541ADFBC8785DE8793A -ListTitle MyList4 -DisplayFormUrl "" -EditFormUrl "" -NewFormUrl "" -UpdateChildren $false
----- EXAMPLE 2 ------
Hide site content type and update the children
Set-SPOContentType -ContentTypeID 0x005EA3C6CA1B82D541ADFBC87 -Hidden $true -UpdateChildren $true
----- EXAMPLE 3 ------
Hide list content type and not update the children
Set-SPOContentType -ContentTypeID 0x005EA3C6CA1B82D541ADFBC87 -Hidden $true -UpdateChildren $false -ListTitle MyList4
See Also
SPOMod Cmdlets and Resources
Connect-SPOCSOM
Get-SPOList
Get-SPOListColumn
New-SPOSiteContentType
New-SPOListContentType
New-SPOSiteContentTypeColumn
Articles
Wiki: SharePoint Online content types in Powershell: Add
Wiki: SharePoint Online content types in Powershell: Get
Wiki: SharePoint Online content types in Powershell: Edit