'ensure' commands #1427
Replies: 3 comments 6 replies
-
By implementing Consider the below script, this would create a site, create a site field, create a content type, add a field to the content type, create a list and finally add the content type to the list.
Using the |
Beta Was this translation helpful? Give feedback.
-
Definitely a great idea, almost without exception the scripts I write using CLI are designed to be idempotent, any Typically my use cases revolve around the assets already mentioned by @garrytrinder but I'd also add
|
Beta Was this translation helpful? Give feedback.
-
😍love the idea... @waldekmastykarz, @garrytrinder what do you think about making this 'official' and add issue to track it and issues for each command? |
Beta Was this translation helpful? Give feedback.
-
Currently, Office 365 CLI has dedicated commands for retrieving, creating and updating resources. If you were to create a script that ensures a specific configuration, for each resource you'd need to see if it exists, create it if it doesn't or update it if it does.
We're thinking about simplifying this scenario by introducing commands with a new verb named
ensure
. For example, to ensure that a particular site collection exists, instead of executing a combination ofspo site list
/spo site get
,spo site add
andspo site set
, you'd executespo site ensure
with the necessary parameters which would automatically verify if the particular site exists and matches your configuration. If the site doesn't exist, it would create it. If it does, the command would check if the properties you specified match the retrieved site and update them if necessary.Would you find this useful? Do you have other ideas or feedback that we should take into account when implementing this? We'll start to implement this idea on the
spo site
commands.Beta Was this translation helpful? Give feedback.
All reactions