Support for Parameter Aliasing? #369
Replies: 2 comments 2 replies
-
The current design aligns more with the PowerShell best practice of module qualified cmdlet naming. Aliases are very useful when used interactively, but for a configuration (like a script), the desire is to be fully qualified such that you get exactly what you expect. If you can provide a clear user scenario where aliases would be used and recommended, we can consider it. |
Beta Was this translation helpful? Give feedback.
-
There are a couple of clear scenarios, in my opinion: Increased ClarityMuch of the technical world believes brevity to be the soul of wit. If we are mapping directly to an underlying resource with an obscure parameter name, carrying on that parameter name will make the resulting resource as unclear as it's source. Thus for usability, most resource parameters will already effectively be an alias. Of course, this presents an obvious problem: Decreased Error RoutesIf I were to know the underlying subsystem first, and be learning PowerShell, I'd be more likely to presume a configuration value that directly maps to the obscure switch. And I would then be wrong and have a bad user experience around DSC. I'd argue every time someone puts a name in for a parameter that they believe should be obvious, and it is not supported in favor of a slightly different variant, they have a bad customer experience. (e.g. it wasn't This is why I've come to adopt the user-friendly maxim of "don't worry, be alias happy". Aliases make people happyAt present this is the only part of PowerShell that is not capable of being alias happy. Aliases have long proven their value within the ecosystem. For many people, this might be their first time using PowerShell. Why not show it the good side? Also, pipeline by name bindingIf using ValueFromPipelineByPropertyName, the more aliases I have, the more objects I can work with. Being able to cleanly pipe N different objects into similar resources would be quite powerful. Conclusion & RebuttalThis covers several arguments for aliasing. I hope it has made the benefits clear. To rebut one point: if the desire is to be "fully qualified", aliases do not prevent that in the least. Since they all map to the same parameter, it is still "fully qualified". Hope this Helps! |
Beta Was this translation helpful? Give feedback.
-
In a quick look at the schemas, I don't think I've seen anything to support resource / parameter aliasing.
In my opinion, aliasing support is a big part of what can make PowerShell more usable.
I think this is especially potent when PowerShell connects to other ecosystems, as naming in PowerShell tends to be more "natural" than the underlying native name.
Would it be possible to slightly extend the schemas and commands to support aliasing, so that these resources can be used more flexibly?
Beta Was this translation helpful? Give feedback.
All reactions