Ask A Question

View Question

Hello,

I am using a global PowerShell script with parameters for things like updating the status of issues that have been deployed.

This works but I tried introducing a new switch parameter to the script and can't seem to pass the correct value. I tried passing True, true, 1, "`$True", $True - all of these result in either PowerShell thinking it's a string or a "no such variable" complaint from BuildMaster for the case of $True. I also tried omitting a value when the param was of type switch - also doesn't work, the plan doesn't validate.

I have fixed it by means of using a String which can be either "True" or "False" but this workaround bothers me greatly.

The full error message is:

Unhandled exception: System.Management.Automation.ParameterBindingArgumentTransformationException: Cannot process argument transformation on parameter 'useBuildNo'. Cannot convert value "System.String" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or 0. ---> System.Management.Automation.ArgumentTransformationMetadataException: Cannot convert value "System.String" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or 0. ---> System.Management.Automation.PSInvalidCastException: Cannot convert value "System.String" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or 0.

Product: BuildMaster
Version: 5.6.3

Hello Stefan,

Thanks for the bug report!

I've filed this as Windows#29 and submitted a pull request with a fix.

Answer Question