pnp/cli-microsoft365

Enhancement: Add folder color to `spo folder get`

開放

#5,896 建立於 2024年3月8日

 (5 則留言) (2 個反應) (0 位負責人)TypeScript (399 個分叉)auto 404
enhancementhelp wantedkeep-openneeds research

倉庫指標

星標
 (1,390 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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.

貢獻者指南