Product: PowerShell Universal
Version: 4.4.0 (using Linux Docker container ironmansoftware/universal:4.4.0-ubuntu-20.04)
I have a script that has a ValidateSet()
in the Param
block:
[ValidateSet('chocolatey', 'chocolatey-community')]
I schedule the script manually (all of this is through the UI) and select the parameter:
I run the schedule immediately to ensure it works. And it does.
At the scheduled time, the script runs and I get this error:
[error] Cannot validate argument on parameter 'Organization'. The argument ""chocolatey-community"" does not belong to the set "chocolatey,chocolatey-community" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.
When I check the schedule, the parameter has changed from chocolatey
to "\"chocolatey\""
, which fails the validation, as you’d expect (I can’t add a screenshot as it only allows me to add one).
My question is, why is this being changed and therefore failing the script? Note that I have nothing running that would change anything like this.