Multi Choice Allows for a Duplicate Shortcut Key
tommymaynard opened this issue · 2 comments
The multi choice parameter allows you to use the same letter as a shortcut key for more than one choice.
<choice label="&Private"
help="Adds a Private folder to the module root."
value="Private" />
<choice label="&Public"
help="Adds a Public folder to the module root."
value="Public" />
In the above example, if the letter "P" is used as a shortcut it will create both the Private and Public folder. My current work around is to use different letters.
<choice label="P&rivate"
help="Adds a Private folder to the module root."
value="Private" />
<choice label="P&ublic"
help="Adds a Public folder to the module root."
value="Public" />
It seems buggy that Invoke-Plaster, and perhaps Test-PlasterManifest, would allow for this behavior. The expected behavior would be an indication to the user that there's a conflict, and that a different value should be used for one of the choice labels.
+1 I just ran into the same where I had to choices starting with the same letter
I tried looking at the code, and it doesn't seem that this is something that Plaster does automatically, it is a function of the [System.Management.Automation.Host.ChoiceDescription]
Label
property. It is based on where you place the &
.
The workaround is the solution in this case I think.