Help Centre › Building Processes
Run a PowerShell script and capture its output.
Add it to a process
In the process designer, open the Add step tab. Find Run PowerShell script under Process, or type its name in the search box, and drag it onto the canvas.
Fields
| Field | Required | What it does |
|---|---|---|
| Script | No | The PowerShell script to run (use this or path, not both) |
| Or a script file | No | Path to an existing .ps1 file to run instead of an inline script |
| Output variable | No | Name of the variable where the result will be stored |
| Parse output as JSON | No | Parse the output as JSON into a structured variable; end the script with `| ConvertTo-Json` |
| Arguments | No | Arguments passed to the script |
| Exit-code variable | No | Variable to store the exit code, for branching on success |
| Full-result variable | No | Variable to store the full result object (stdout, stderr, exit code, duration) |
| Timeout (seconds) | No | Seconds to wait before the script is stopped (default 60, 0 for no limit) |
| Standard input | No | Text piped to the script's standard input |
| Working directory | No | Working directory to run the script in |
| Environment variables | No | Extra environment variables for the script |
| Window style | No | Console window style (Windows only) Choices: Normal, Hidden, Minimized, Maximized. |
| Fail on non-zero exit | No | Fail the step when the script exits non-zero (default true) Default: on. |
| Inherit environment | No | Pass the bot's own environment to the script (default true) |
| Run as Administrator | No | Run elevated. Windows only, and needs a human at the UAC prompt |
What it gives back
{variable}– The script's output - a string, or the parsed record when json is true{exit_code_variable}– The script's exit code{result_variable}– {command, stdout, stderr, exit code, pid, timed out, duration, succeeded}
See all Process steps.