Setting arbitrary properties on SharePoint objects #1424
Unanswered
waldekmastykarz
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
At this moment, the most of SharePoint
set
commands in the Office 365 CLI support only a handful of options that correspond to the properties of their SharePoint class, likeWeb
,Site
,List
, etc. This is similar to how theSet-PnP*
cmdlets work. However, because PnP PowerShell works with CSOM, this limitation there is often circumvented, by retrieving the CSOM object, updating its properties and calling$object.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're thinking about addressing this limitation by allowing you to set the value of any property exposed on the SharePoint object. This would work only for properties that have values of simple types like
bool
,string
orint
because complex values likely can't be serialized tostring
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 particular SharePoint class have setters and values of the supported types and thus can be used.
What do you think of this approach? Would this help to solve a problem you have? In the previous release, we have extended the
spo web set
command with this functionality. Have you tried it? If so, what do you think of it?Beta Was this translation helpful? Give feedback.
All reactions