Skip to content

Enhancement: Allow setting arbitrary properties on web #1202

@waldekmastykarz

Description

@waldekmastykarz

The spo web set property should allow users to update the value of any property supported by the Web class in SPO.

At this moment, the spo web set command supports only a handful of options that correspond to the properties of the Web class. This is similar to the Set-PnPWeb cmdlet. However, because PnP PowerShell works with CSOM, this limitation is often circumvented, by retrieving the web CSOM object, updating its properties and calling $web.ExecuteQuery() to persist the changes outside of PnP cmdlets. Because the CLI doesn't use CSOM, this isn't possible and users are limited to using whatever options are exposed by the CLI commands.

We could address this limitation by allowing users to set the value of any property exposed on the Web object. This would work only for properties that have values of simple types like bool, string or int, because complex values likely can't be serialized to string without additional logic.

We would offer rudimentary logic of checking if the specified properties are valid, by examining the latest version of the SPO CSOM assemblies and checking which properties on the Web class have setters and values of the supported types and thus can be used.

By looking at the telemetry, we can track the usage of the different properties and gradually implement native support for the most frequently used properties.

Once the approach is validated, we could implement it on other types like site, list, listitem, field, file, etc.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions