Enum parameters that map to a series of original parameters #134
WillPittenger
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Suppose your native application has the switch parameters
-p
and-s
. They can only be used if the other wasn't used. You could create multiple parameter sets. However, it gets really messy the more such combinations are available. Suppose the native application has 10 such pairs. So now your list of parameter sets gets rather ridiculous. It would be better for the cmdlet to take an eum for each parameter. It might be something like shown below.So now you map the enum such that
Combo.val1
is the default value which doesn't pass anything,Combo.val2
would pass-p
, andCombo.val3
would pass-s
. This is harder than the map alone unless the enum type was declared by .NET or PowerShell. In such cases, the JSON needs to be able to declare the enum. But the schema I've seen doesn't seem to describe enum declarations.Beta Was this translation helpful? Give feedback.
All reactions