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!
Defining a script asset for output parameters accessed by PSCall
-
I understand that PSCall has the ability to access output parameters from the script asset being called. What I don't understand is is how to define the script so that it has output parameters that will be accessible to PSCall.
I'm very familiar with powershell. I've tried creating a script asset parameter with a [ref] parameter but that didn't work the way I did it.
By the way, the docs for PSCall include a reference to an hdars script. It would be nice if the content of the hdars script was included in the docs for PSCall as well.
Product: BuildMaster
Version: 5.6.9
-
Here's what I've come up with, though I can't vouch for its correctness. It would appear that output parameters with PSCall are simply normal script variables that you tell PSCall to pull out of the script context at the end of execution. It may say this in the docs and I just read over it.
Script Asset named 'say-hello.ps1' in an application named 'Prototyping'.
param([string]$name) $hello = "hello {0}" -f $name
PSCall operation in plan
PSCall Prototyping::say-hello ( name: '"mary"', hello => $output );
After the execution of the PSCall operation, the
$output
variable contains:Hello mary
-
Correct. Output variables don't need to be specially declared.
However, the next version of the Windows plugin for BuildMaster and Otter will add support for [ref] parameters as output variables in the editor.