[Feedback wanted!] Configuration Cmdlets for Azure PowerShell #16871
Replies: 2 comments 2 replies
-
I can see both the approaches working, would prefer the first (dynamic params) one. Maybe it's al little bit of topic, but don't know where to drop this. Would it be possible for the 'BreakingChangeMessage' to appear once per session (per cmdlet call) instead of on every call? |
Beta Was this translation helpful? Give feedback.
-
It's also important to remember that the first option also supports splatting.
And if you use
Both of these will be more intuitive and naturally fit into PowerShell. Lean in on how PowerShell was intended to be used before trying other stuff. I also think you are taking the wrong approach in the "traditional" example. Change that from an array of hashtables to just a hashtable, then you can just do this: (assuming -Config is positional parameter 0)
This is a DSL style approach. A little bit clever, but still more natural to work with than your original traditional example. I think an array of hashtables would be the worst of all the options. (Design for the user, not the internal data structures) |
Beta Was this translation helpful? Give feedback.
-
Hi 👋, this is Yeming from Azure PowerShell team. In the upcoming releases we plan to introduce a set of cmdlets to help you configure the behavior of Azure PowerShell, which used to be done by environment variables or several seperate cmdlets. Here's a first peek of what it looks like:
Examples
Syntax
How to specify the key of a config
One interesting design decision we made is how to specify the key of a config in these cmdlets. Considering the scenario to update 2 configs.
Take a look at the
-ConfigA
and-ConfigB
- these parameters are mapped from configs and dynamically added to the cmdlets. We find this design more intuitive to use. Also you can easily learn about every config byGet-Help
.However, the weakness is the list of parameters grows as the number of supported configs grows. The cmdlet syntax can be quite long as time goes.
Comparing to a more traditional approach, for example:
The traditional design scales better as more configs are added to Azure PowerShell -- cmdlet syntax does not change at all. But it loses the benifits in documentation and is a little bit more complex.
We want to hear from you 😉
How do you like the two different approaches of specifying a config key?
Which one do you prefer?
Have these cmdlets satisfied your needs in configs?
Let us know down in the comments. Looking forward to hearing your thoughts!
Beta Was this translation helpful? Give feedback.
All reactions