Skip to main content

spo folder set

Updates a folder


m365 spo folder set [options]


m365 spo folder rename [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 for more information and examples.

-o, --output [output]

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


Runs command with verbose logging.


Runs command with debug logging.


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

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


Set the folder name to 'My Folder 2'

m365 spo folder set --webUrl --url '/Shared Documents/My Folder 1' --name 'My Folder 2'

Set the folder name to 'My folder 2'

m365 spo folder set --webUrl --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 --url '/ProjectFiles/Project-x' --color 5

Set the folder color to light teal

m365 spo folder set --webUrl --url '/ProjectFiles/Project-x' --color lightTeal


The command won't return a response on success.