New command: update content type
Usage
m365 spo contenttype set [options]
Description
Update existing content type
Options
| Option | Description |
|---|---|
-u, --webUrl <webUrl> |
URL of the site where the content type to update is defined |
-i, --id [id] |
ID of the content type to update. Specify the ID or name but not both, one is required. |
-n, --name [name] |
Name of the content type to update. Specify the ID or the name but not both, one is required |
--listTitle [listTitle] |
Name of the list if you want to update a list content type. Specify either listTitle, listId or listUrl |
--listId [listId] |
ID of the list if you want to update a list content type. Specify either listTitle, listId or listUrl |
--listUrl [listUrl] |
URL of the list if you want to update a list content type. Specify either listTitle, listId or listUrl |
Examples
Move site content type to a different group:
m365 spo contenttype set --id 0x001001 --webUrl https://contoso.sharepoint.com --Group "My group"
Rename list content type:
m365 spo contenttype set --id 0x001001 --webUrl https://contoso.sharepoint.com --listTitle "My list" --Name "My item"
Additional Info
This command supports using unknown properties. Unknown properties map to the properties of the ContentType CSOM object that support setting a value. This command is highly useful for scenarios like deploying SPFx form customizers.
@pnp/cli-for-microsoft-365-maintainers any feedback?
Looks good to me 👍 Only comment I have is to maybe provide another useful example.
Any common content type update operations that you'd suggest @milanholemans?
Was thinking something like setting fields of content types. But just noticed we have separate commands for that spo contenttype field set|remove.
Maybe an extra example to update the content type group or description? No idea what else could be useful.
Great suggestion! 🚀
Should we maybe mention with the options listTitle and listId that one of them is required when they want to update a list content type. Also, maybe an example of how to update a list content type could be nice to have.
maybe we could also add --listUrl 🤔?
@milanholemans, @waldekmastykarz I think a good example would be to change a description of the CT
<Property Name="Description" Type="String"/>
or CT Group
<Property Name="Group" Type="String">
This command is highly useful for scenarios like deploying SPFx form customizers.
Now I'm curious @waldekmastykarz!
Looks great by the way
Now I'm curious @waldekmastykarz!
Come watch my demo on the community call today 😄
@milanholemans:
Maybe an extra example to update the content type group or description
Great suggestion, updated spec
@Jwaegebaert:
Should we maybe mention with the options listTitle and listId that one of them is required when they want to update a list content type
Isn't the current description Name of the list if you want to update a list content type. clear? Would it be clearer to repeat it?
Also, maybe an example of how to update a list content type could be nice to have.
Good idea! Updated the spec.
@Adam-it:
maybe we could also add --listUrl
Yes! Updated the spec
Isn't the current description Name of the list if you want to update a list content type. clear? Would it be clearer to repeat it?
Yeah, on second thought, that should be clear enough for the users 😄
Come watch my demo on the community call today 😄
Ah, I see. so you can add ContentType.DisplayFormClientComponentProperties 😉
Exactly!
Exactly!
BTW nice demo 👍.