Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

Passing bool or switch parameter to PSCall



  • 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


  • inedo-engineer

    Hello Stefan,

    Thanks for the bug report!

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



  • Awesome Ben, thanks for the quick action!

    I've followed the issue, will I get an automated notification when it's known in which version the fix is going to be available?



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation