SharePoint Online SPOMod: New-SPOListContentType
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.
New-SPOListContentType
Creates a new list content type and adds it directly to the list.
Parameters
Description | Optional | String. Description of the content type. |
Name | Mandatory | String. Name of the content type. Has to be unique in each list. |
Group | Optional | String. Group to which the content type should belong. If not specified, the content type will be added to "Custom Content Type" group. |
ParentContentTypeID | Mandatory | String. The ID of a parent content type, from which the new content type will be inheriting, e.g. "0x01" for an ITEM. This parameter is mutually exclusive with ContentTypeID. To find out why or how the ID shows the content type's lineage, please go here |
ContentTypeID | Mandatory | String. The ID of the new content type. This parameter is mutually exclusive with ParentContentTypeID. To find out how to construct a valid ID, please go here |
ListID | Mandatory | String. ID of the list where the new content type will be added. Mutually exclusive with ListName. |
ListName | Mandatory | String. Title of the list where the new content type will be added. Mutually exclusive with ListID. |
Examples
----- EXAMPLE 1 ------
Create a content type and add it to the list.
New-SPOListContentType -Name "NaList2NeverHappenedBefore" -ParentContentTypeID "0x01" -ListName "MyList6"
----- EXAMPLE 2 ------
Create a content type based on MESSAGE parent content type by specifying its ID
New-SPOListContentType -Name "NaList2NeverHappenedBefore2" -ContentTypeID "0x010722" -ListName "MyList6"
See Also
SPOMod Cmdlets and Resources
Connect-SPOCSOM
Get-SPOList
Get-SPOListColumn
New-SPOSiteContentType
Wiki: SharePoint Online content types in Powershell: Add
Wiki: SharePoint Online content types in Powershell: Get
Wiki: SharePoint Online content types in Powershell: Edit