HOWTO: Pass the output of a PowerShell command to an Ivanti Automation parameter?

Version 3

    Question

    How can the output of a PowerShell script being added to a parameter in an Automation task?

     

    It's not possible to pass a PowerShell object to a parameter, only text output can be passed.

     

    Answer

    Enable the option 'Set parameter with standard output:' in the 'Execute Windows PowerShell Script' window.

     

    By default the 'StandardOut' parameter is a 'Multi-line text' parameter. The parameter can also be created as 'Text' parameter, if it is created manually.

     

     

    From Ivanti Automation 2018.1.1 it is possible to pass output to multiple Automation parameters in one task.

     

    Multiple Automation parameters can be filled using one PowerShell script. Reference each parameter as “$global:<parameter_name>= <Input string>”.

     

    Notes:

    • The parameter in the PowerShell script is case-sensitive.
    • Using multiple parameters in one PowerShell script only works on the Agent+ component and only works with the built-in task: Windows PowerShell Script (Execute).
    • The 'Set parameter with standard output' option (as described above) must be enabled.