spo commandset set
Updates a ListView Command Set on a site
Usage
m365 spo commandset set [options]
Options
-u, --webUrl <webUrl>
The site to update the ListView Command Set on.
-t, --title [title]
The title of the ListView Command Set to update. Specify either
title
,id
orclientSideComponentId
.-i, --id [id]
The id of the ListView Command Set to update. Specify either
title
,id
orclientSideComponentId
.-c, --clientSideComponentId [clientSideComponentId]
The Client Side Component Id (GUID) of the ListView Command Set to update. Specify either
title
,id
orclientSideComponentId
.--newClientSideComponentId [newClientSideComponentId]
The new Client Side Component Id (GUID) of the ListView Command Set.
--newTitle [newTitle]
The new title of the ListView Command Set.
-l, --listType [listType]
The list or library type to register the Command Set on. Allowed values are:
List
,Library
orSitePages
.--clientSideComponentProperties [clientSideComponentProperties]
The Client Side Component properties of the ListView Command Set.
-s, --scope [scope]
The scope where to lookup the ListView Command Set: at site level or web level. Allowed values are:
Site
,Web
,All
. Defaults toAll
.--location [location]
The location of the ListView Command Set. Allowed values are:
ContextMenu
,CommandBar
orBoth
.
-h, --help [help]
Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are
options
,examples
,remarks
,response
,full
. Default isoptions
.--query [query]
JMESPath query string. See http://jmespath.org/ for more information and examples.
-o, --output [output]
Output type.
json
,text
,csv
,md
,none
. Defaultjson
.--verbose
Runs command with verbose logging.
--debug
Runs command with debug logging.
Remarks
Running this command from the Windows Command Shell (cmd.exe) or PowerShell for Windows OS XP, 7, 8, 8.1 without bash installed might require additional formatting for command options that have JSON, XML or JavaScript values because the command shell treats quotes differently. For example, this is how a ListView Command Set can be created from the Windows cmd.exe:
m365 spo commandset set --webUrl https://contoso.sharepoint.com/sites/test --title "CLI Commandset" --location "Both" --listType "List" --clientSideComponentProperties '{\"testMessage\":\"Test message\"}'
Note, how the clientSideComponentProperties option has escaped double quotes '{\"testMessage\":\"Test message\"}'
compared to execution from bash '{"testMessage":"Test message"}'
.
When using the --clientSideComponentProperties
option it's possible to enter a JSON string. In PowerShell 5 to 7.2 specific escaping rules apply due to an issue. Remember that you can also use file tokens instead.
This command can be used for updating a ListView Command Set on a specific site. To update a ListView Command Set that's installed tenant-wide, view our dedicated spo tenant commandset set command.
Examples
Updates the title and location of a ListView Command Set on the sales site.
m365 spo commandset set --clientSideComponentId 799883f5-7962-4384-a10a-105adaec6ffc --newTitle "Some new title" --location Both --webUrl https://contoso.sharepoint.com/sites/sales --scope Site
Updates a ListView Command Set on the sales site with some properties.
m365 spo commandset set --title "Some customizer" --clientSideComponentProperties '{ "someProperty": "Some value" }' --webUrl https://contoso.sharepoint.com/sites/sales --scope Site
Updates the Client Side Component Id of a ListView Command Set.
m365 spo commandset set --title "Some customizer" --newClientSideComponentId b2c5faf3-638f-44ae-bfde-1730d94283bf --webUrl https://contoso.sharepoint.com/sites/sales
Response
The command won't return a response on success.