Windows PowerShell Home
Array parameters with the ValidateSet attribute are incorrectly represented in the show-command ui
11/15/2012 11:06:19 PM
User(s) can reproduce this bug
If you have an advance script method which has an parameter with an array type, and the ValidateSet attribute to make sure that each value in the array is in the set. The the show-command ui parameter wizard will display a combo box for that value allowing the user to select only a single value from the set, instead of allowing multiple values to be specified.
How often does this happen?
Have you seen this problem before in this product?
No, this is new to the most recent version
create a module creating an advanced script function using ValidateSet on an array parameter. For instance :
Now when you select this method in the ise commands addin or using the show-command, the testparam parameter will be represented with a combo box containing the values a, b & c, however the as the testparam parameter is an array I should be able to specify multiple values.
i.e. From the powershell console I can execute :
test-validateset -testparam a,c
And each value in the testparam array is validated against the set. However using the show-command ui I am limited to only selecting a single value.
Ideally some kind of array aware control, which would allow multiple values to be added. Or in the least a text edit control so that at least multiple values can be specified similar to the behavior of a normal array parameter which doesn't have the ValidateSet attribute added.
to post a comment.
Please enter a comment.
to post a workaround.
Please enter a workaround.
© 2013 Microsoft