2026.3.1 - Can run script without all parameters being filled

2026.3.1 - Can run script without all parameters being filled

avatar

In current version if you have a param with a ValidateSet and tab between fields and use keyboard to select the option from the drop down the job will be submitted when pressing enter to choose your selection.

Example Script:

param(
    [ValidateSet( 'Test1', 'Test2' )]
    [string] $Test
)


Reproducing:

  1. Run script
  2. Select the Test field to highlight
  3. Use arrow keys on keyboard to select value
  4. Press enter
  5. Script runs without parameter value being selected, any subsequent parameters are ignored


Note that this does not affect [string[]] inputs with or without validate set.

IMO, the Enter key should NEVER launch the script. There is a chance the script can be run with incomplete parameters and cause major issues.

All Comments (2)

avatar

Additionally, selecting the option from the drop down with the mouse seems to lock up any remaining string options with a ValidateSet decorator.

avatar

Hello @realslacker

Thank you for the detailed report and reproduction steps.

We are going to test this behavior internally on 2026.3.1, focusing on the Enter key behavior with ValidateSet parameters and comparing keyboard versus mouse selection. We will also check the difference between [string] and [string[]] parameters and verify how the form behaves when additional or mandatory parameters are present.

We will update the thread once we have completed the reproduction tests.

Best regards,
Ruben Tapia