You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Multi Choice Allows for a Duplicate Shortcut Key #346
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.
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 &.
Activity
janegilring commentedon Mar 7, 2019
+1 I just ran into the same where I had to choices starting with the same letter
tomlarse commentedon Mar 13, 2019
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]Labelproperty. It is based on where you place the&.https://docs.microsoft.com/en-us/dotnet/api/system.management.automation.host.choicedescription.label?view=powershellsdk-1.1.0#System_Management_Automation_Host_ChoiceDescription_Label
The workaround is the solution in this case I think.