spo propertybag set
Sets the value of the specified property in the property bag. Adds the property if it does not exist
Usage
m365 spo propertybag set [options]
Options
-u, --webUrl <webUrl>The URL of the site in which the property should be set
-k, --key <key>Key of the property to be set. Case-sensitive
-v, --value <value>Value of the property to be set
--folder [folder]Site-relative URL of the folder on which the property should be set
-h, --help [help]Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are
options,examples,remarks,permissions,response,full. Default isoptions.--query [query]JMESPath query string. See http://jmespath.org/ for more information and examples.
-o, --output [output]Output type.
json,text,csv,md,none. Defaultjson.--verboseRuns command with verbose logging.
--debugRuns command with debug logging.
Remarks
If a site has NoScript enabled, setting property bag values may result in an Access is denied error. To resolve this, you can configure a tenant-wide property to allow property bag updates on NoScript sites.
Examples
Sets the value of the property in the property bag of the given site
m365 spo propertybag set --webUrl https://contoso.sharepoint.com/sites/test --key key1 --value value1
Sets the value of the property in the property bag of the root folder of the given site
m365 spo propertybag set --webUrl https://contoso.sharepoint.com/sites/test --key key1 --value value1 --folder /
Sets the value of the property in the property bag of a document library located in the given site
m365 spo propertybag set --webUrl https://contoso.sharepoint.com/sites/test --key key1 --value value1 --folder '/Shared Documents'
Sets the value of the property in the property bag of a folder in a document library located in the given site
m365 spo propertybag set --webUrl https://contoso.sharepoint.com/sites/test --key key1 --value value1 --folder '/Shared Documents/MyFolder'
Sets the value of the property in the property bag of a list in the given site
m365 spo propertybag set --webUrl https://contoso.sharepoint.com/sites/test --key key1 --value value1 --folder /Lists/MyList
Response
The command won't return a response on success.