You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea is to add some options to set the color of a folder in SharePoint.
Commands to update
spo folder rename
Caution
Currently we can only rename a folder using spo folder rename. I suggest that we rename this command to spo folder set where we can update 2 options name and color. Let's create an alias to spo folder rename so the command doesn't break. This alias can be removed in V8.
Options to add
Option
Description
--color [color]
Visual color of the folder. Valid values are a color name or a number. Check remarks for more info.
Remarks:
When you specify a value for color, consider the following:
Color
Number value
String value
Yellow
0
yellow
Dark red
1
darkRed
Dark orange
2
darkOrange
Dark green
3
darkGreen
Dark teal
4
darkTeal
Dark blue
5
darkBlue
Dark purple
6
darkPurple
Dark pink
7
darkPink
Grey
8
darkGrey
Light red
9
lightRed
Light orange
10
lightOrange
Light green
11
lightGreen
Light teal
12
lightTeal
Light blue
13
lightBlue
Light purple
14
lightPurple
Light pink
15
lightPink
Examples
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
Technical approach
We can use 3 APIs here.
Keep the current API when only name is specified.
Use API below when only color is specified.
POST https://tenant.sharepoint.com/sites/MySite/_api/foldercoloring/stampcolor(DecodedUrl='/sites/MySite/Projects/Project-x')
{
"coloringInformation": {
"ColorHex": "5"
}
}
Use API below when both options are specified.
POST https://tenant.sharepoint.com/sites/MySite/_api/foldercoloring/renamefolder(DecodedUrl='/sites/MySite/Projects/Project-x')
{
"newName": "New folder name",
"coloringInformation": {
"ColorHex": "5"
}
}
The idea is to add some options to set the color of a folder in SharePoint.
Commands to update
spo folder renameCaution
Currently we can only rename a folder using
spo folder rename. I suggest that we rename this command tospo folder setwhere we can update 2 optionsnameandcolor. Let's create an alias tospo folder renameso the command doesn't break. This alias can be removed in V8.Options to add
--color [color]Remarks:
When you specify a value for
color, consider the following:0yellow1darkRed2darkOrange3darkGreen4darkTeal5darkBlue6darkPurple7darkPink8darkGrey9lightRed10lightOrange11lightGreen12lightTeal13lightBlue14lightPurple15lightPinkExamples
Set the folder color to dark blue
Set the folder color to light teal
Technical approach
We can use 3 APIs here.
nameis specified.coloris specified.