Skip to main content

spo folder set

Updates a folder

Usage

m365 spo folder set [options]

Alias

m365 spo folder rename [options]

Options

-u, --webUrl <webUrl>

The URL of the site where the folder is located.

--url <url>

The server- or site-relative decoded URL of the folder.

-n, --name [name]

New name for the folder.

--color [color]

Visual color of the folder. Valid values are a color name or a number. Check remarks for more info.

-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 is options.

--query [query]

JMESPath query string. See http://jmespath.org/ for more information and examples.

-o, --output [output]

Output type. json, text, csv, md, none. Default json.

--verbose

Runs command with verbose logging.

--debug

Runs command with debug logging.

Remarks

When you specify a value for color, consider the following:

ColorNumber valueString value
Yellow0yellow
Dark red1darkRed
Dark orange2darkOrange
Dark green3darkGreen
Dark teal4darkTeal
Dark blue5darkBlue
Dark purple6darkPurple
Dark pink7darkPink
Grey8grey
Light red9lightRed
Light orange10lightOrange
Light green11lightGreen
Light teal12lightTeal
Light blue13lightBlue
Light purple14lightPurple
Light pink15lightPink

Examples

Set the folder name to 'My Folder 2'

m365 spo folder set --webUrl https://contoso.sharepoint.com/sites/project-x --url '/Shared Documents/My Folder 1' --name 'My Folder 2'

Set the folder name to 'My folder 2'

m365 spo folder set --webUrl https://contoso.sharepoint.com/sites/project-x --url '/sites/project-x/Shared Documents/My Folder 1' --name 'My Folder 2'

Set the folder color to dark blue

m365 spo folder set --webUrl https://contoso.sharepoint.com --url '/ProjectFiles/Project-x' --color 5

Set the folder color to light teal

m365 spo folder set --webUrl https://contoso.sharepoint.com --url '/ProjectFiles/Project-x' --color lightTeal

Response

The command won't return a response on success.

CTRL + M