Hi,
I've noticed the following behaviour when using DontShow as a parameter definition in scripts
example:param( [Parameter()] $Test, [Parameter(DontShow)] $Test2)
When running the script in the GUI 'Test2' does not show, which is expected and correct.
However, When using the following command in another script:
This works:Invoke-PSUScript -Script "HelloWorld.ps1" -Integrated -Parameters @{Test="testString"}
This fails:Invoke-PSUScript -Script "HelloWorld.ps1" -Integrated -Parameters @{Test="testString";Test2="asdsad"}
The error message is:Unknown parameter Test2. Parameters for this script are Test
Expected behaviour for me is that DontShow is reflected in the admin menu run script popup, but still available as a parameter via Invoke-PSUScript. Is this a bug or is this intentional behaviour?
Thanks,
Tom
@insomniacc This isn't intentional. I've opened an issue for this because it should be usable.
Adam Driscoll
PowerShell Expert and Developer at Devolutions