---
title: "PSCall2"
---
Calls a PowerShell Script that is stored as an asset.
PSCall(
Name: <text>,
[Parameters: <%(key1: value1, ...)>],
[InputVariables: <%(key1: value1, ...)>],
[OutputVariables: <@(text)>],
[PreferWindowsPowerShell: <text>]
);
This operation may be prefixed with PowerShell::
, although this is a built-in namespace and isn't really necessary.
Name | Format | Script Usage | Usage Notes |
---|---|---|---|
☆ Name (default) | text | Name | The name of the script asset. This argument is required. |
Parameters | %(key1: value1, ...) | Parameters | |
InputVariables | %(key1: value1, ...) | InputVariables | |
OutputVariables | @(text) | OutputVariables | |
Prefer Windows PowerShell | text | PreferWindowsPowerShell | When true, the script will be run using Windows PowerShell 5.1 where available. When false or on Linux (or on Windows systems without PowerShell 5.1 installed), the script will be run using PowerShell Core instead. Default value is "$PreferWindowsPowerShell". |
Note: An argument may be explicitly converted to an integral type by prefixing the value with [type::<typeName>], where <typeName> is one of: int, uint, long, ulong, double, decimal. Normally this conversion is performed automatically and this is not necessary.
# execute the hdars.ps1 script, passing Argument1 and Aaaaaarg2 as input variables, and capturing the value of OutputArg as $OutputArg
PSCall2 hdars.ps1 (
InputVariables: %(Argument1: hello, Aaaaaarg2: World),
OutputVariables: @(MyOutputArg)
);