> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/automation/jobs.md).

# Jobs

Track PowerShell Universal jobs, inspect output and statuses, configure output guardrails and sensitive-data redaction, and invoke jobs from scripts, apps, and REST.

Jobs are script executions. View them under **Run > Jobs** to inspect status, stream output, pipeline output, errors, feedback requests, script version, and job metadata.

## Output

PowerShell stream output, including information, host, error, warning, and verbose records, is shown in the job output pane. Objects written to the pipeline are stored as CliXml and are available from the **Pipeline Output** tab.

Configure **Large job output behavior** and **Maximum job output size (KB)** under **Settings gear > Automation** to protect the instance from excessive output. The default maximum is **10,240 KB**; set it to `0` to disable the limit.

| Behavior | Result                                                     |
| -------- | ---------------------------------------------------------- |
| Warn     | Retains output and creates a warning. This is the default. |
| Truncate | Stores output only up to the limit.                        |
| Compress | Stores excess output in compressed form.                   |
| Ignore   | Does not apply the limit or warning behavior.              |

You can also discard pipeline output for an individual script with its **Discard Pipeline** setting.

### Redact sensitive job output

Enable **Redact sensitive job output** under **Settings gear > Automation** to mask values from job output before the output is logged or saved. Redaction is disabled by default.

When enabled, PowerShell Universal replaces matched values with `********` for built-in sensitive key names, including `password`, `secret`, `client_secret`, `api_key`, `access_token`, `token`, `authorization`, `credential`, and `connection_string`. It recognizes common key-value formats such as JSON, HTTP form or query-string data, and colon-delimited output.

```powershell
Write-Host '{"password": "MyPassword"}'
# Job output: {"password": "********"}

Write-Host 'client_secret=MyClientSecret'
# Job output: client_secret=********

Write-Host 'Authorization: [value]'
# Job output: Authorization: ********
```

Add organization-specific field names with **Additional sensitive output keys** on the same settings page. These keys use the same matching patterns as the built-in keys.

Redaction is a best-effort output safety net, not a comprehensive secret scanner. It does not mask values that are not emitted as recognized key-value pairs, including values embedded in custom object formatting or retrieved from a secret provider. Do not write secrets to job output.

## Script version

Each job records the resolved version of the script that started it. Locate the **Script Version** tag in the job header to identify the source used for that execution.

* Git-synchronized repository scripts record the resolved Git commit SHA.
* Module-command scripts record the resolved module version.

The recorded value remains with the job after the script or module changes, providing an execution-time audit trail. Retried jobs use the currently resolved script version when available; otherwise, they retain the original recorded version.

## Status and feedback

Jobs can be **Queued**, **Running**, **Error**, **Warning**, **Failed**, or **Waiting on Feedback**. A `Read-Host` call puts a job in Waiting on Feedback; respond from the job page. Use `Read-Host -AsSecureString` for password input.

## Invoke jobs

Use `Invoke-PSUScript` to start a job and `Wait-PSUJob` to wait for it. From outside PowerShell Universal, use a valid app token.

```powershell
Invoke-PSUScript -Script 'Script1.ps1' -RequiredParameter 'Hello' | Wait-PSUJob
```

Retrieve pipeline output with `Get-PSUJobPipelineOutput`.

```powershell
Get-PSUJobPipelineOutput -JobId 10
```

Use `-Integrated` only from inside PowerShell Universal. Apps can use it with `-Wait` to forward `Write-Progress` and `Read-Host` interactions.

```powershell
New-UDButton -Text 'Run script' -OnClick {
    Invoke-PSUScript -Name 'AppExample.ps1' -Integrated -Wait
} -ShowLoading
```

## Job Run ID

By default, jobs use incrementing numeric IDs. Enable `JobRunID` to use a GUID-based `RunID` for job lookups.

```powershell
Set-PSUSetting -JobRunId
```

## API

* `Invoke-PSUScript`
* `Get-PSUJob`
* `Get-PSUJobOutput`
* `Get-PSUJobPipelineOutput`
* `Wait-PSUJob`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.devolutions.net/powershell-universal/automation/jobs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
