Skip to content

Latest commit

 

History

History
92 lines (58 loc) · 3.81 KB

File metadata and controls

92 lines (58 loc) · 3.81 KB

import Global from '../../_global.mdx';

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`or `clientSideComponentId`.

`-i, --id [id]`
: The id of the ListView Command Set to update. Specify either `title`, `id`or `clientSideComponentId`.

`-c, --clientSideComponentId [clientSideComponentId]`
: The Client Side Component Id (GUID) of the ListView Command Set to update. Specify either `title`, `id`or `clientSideComponentId`.

`--newClientSideComponentId [newClientSideComponentId]`
: The new Client Side Component Id (GUID) of the ListView Command Set.

`--newTitle [newTitle]`
: The new title of the ListView Command Set.

`--description [description]`
: Description of the ListView Command Set. Specify an empty string to clear.

`-l, --listType [listType]`
: The list or library type to register the Command Set on. Allowed values are: `List`, `Library` or `SitePages`.

`--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 to `All`.

`--location [location]`
: The location of the ListView Command Set. Allowed values are: `ContextMenu`, `CommandBar` or `Both`.

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"}'.

:::warning[Escaping JSON in PowerShell]

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.