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
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Script | String | No | Script text (or use file). | |
| File | File | No | Script file (or use script). | |
| Arguments | List | No | Arguments passed to the script, one list item each. | |
| Input | String | No | Text sent to the script's standard input (e.g. JSON). | |
| Timeout (seconds) | Number | No | 300 | Maximum run time. |
| Fail on error | Boolean | No | true | Fail the step when the exit code is not 0. |
| Working folder | File | No | Folder the script runs in; the workspace when empty. | |
| Environment | Dictionary | No | Extra environment variables for the script. | |
| Interpreter | String | No | PowerShell program to use, e.g. pwsh or powershell; PowerShell 7 first when empty. |
Outputs
| Output | Type | What it is |
|---|---|---|
| output | String | Standard output. |
| error_output | String | Standard error. |
| exit_code | Number | Exit code. |
| json | Any | Output parsed as JSON, when it is JSON. |