pnp / pnp/cli-microsoft365

Enhancement: Add folder color to `spo folder get`

Open
#5,896 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted keep-open needs research
Dominant language
TypeScript
Stars
1.5k
Forks
413
Avg merge
5d 6h
Merged PRs (30d)
21

Description

Related to:

  • #5894
  • #5895

The idea for this issue is to read the current folder color.

I suggest that we add a new option.

Option Description
--withColor Also return the color of the folder.

This results in 2 extra properties in the output:

{
  "color": "5",
  "colorValue": "darkBlue"
}

Notice that these 2 properties don't exist natively and we have to create them ourselves.

Tech implementation

Some more research here should be needed. Retrieving the ColorHex field doesn't seem that easy using the REST API.
One way I found is by using:

GET https://tenant.sharepoint.com/sites/Projects/_api/Web/GetFolderByServerRelativePath(DecodedUrl='/sites/Projects/Cortex')?$expand=properties&$select=*,properties/vti_x005f_colorhex

This returns the color hex but it isn't ideal. Let's try to look if there's a better way.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the implementation of spo folder get and the SharePoint REST request described in the issue. Investigate whether a better way exists to retrieve ColorHex, then add the --withColor behavior so the output includes color and colorValue when requested.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.