Skip to main content

Run PowerShell

Run a PowerShell script (PowerShell 7 if installed, otherwise Windows PowerShell).

Command in the Scripts toolkit · id ooa.script/run_powershell · 9 inputs, 4 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
ScriptStringNoScript text (or use file).
FileFileNoScript file (or use script).
ArgumentsListNoArguments passed to the script, one list item each.
InputStringNoText sent to the script's standard input (e.g. JSON).
Timeout (seconds)NumberNo300Maximum run time.
Fail on errorBooleanNotrueFail the step when the exit code is not 0.
Working folderFileNoFolder the script runs in; the workspace when empty.
EnvironmentDictionaryNoExtra environment variables for the script.
InterpreterStringNoPowerShell program to use, e.g. pwsh or powershell; PowerShell 7 first when empty.

Outputs​

OutputTypeWhat it is
outputStringStandard output.
error_outputStringStandard error.
exit_codeNumberExit code.
jsonAnyOutput parsed as JSON, when it is JSON.