> 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/powershell-commands/get-psujob.md).

# Get-PSUJob

Get-PSUJob retrieves jobs run within PowerShell Universal, filterable by status, Id, run Id, or the identity that triggered them.

## SYNOPSIS

Retrieves jobs run within PowerShell Universal.

## SYNTAX

```powershell
Get-PSUJob [-Status <JobStatus>] [-OrderBy <String>] [-OrderDirection <OrderDirection>] [-HideChildren <Boolean>] [-HideScheduled <Boolean>] [-HideTriggered <Boolean>] [-HideArchived <Boolean>] [-Skip <UInt64>] [-First <UInt64>] [-IncludeTotalCount] [<ConnectionOptions>] [<CommonParameters>]
Get-PSUJob -Id <Int64> [-HideChildren <Boolean>] [<ConnectionOptions>] [<CommonParameters>]
Get-PSUJob -RunId <Guid> [-HideChildren <Boolean>] [<ConnectionOptions>] [<CommonParameters>]
Get-PSUJob -Identity <Identity> [-Status <JobStatus>] [-OrderBy <String>] [-OrderDirection <OrderDirection>] [-HideChildren <Boolean>] [-HideScheduled <Boolean>] [-HideTriggered <Boolean>] [-HideArchived <Boolean>] [-Skip <UInt64>] [-First <UInt64>] [-IncludeTotalCount] [<ConnectionOptions>] [<CommonParameters>]
Get-PSUJob -Script <Script> [-Status <JobStatus>] [-OrderBy <String>] [-OrderDirection <OrderDirection>] [-HideChildren <Boolean>] [-HideScheduled <Boolean>] [-HideTriggered <Boolean>] [-HideArchived <Boolean>] [-Skip <UInt64>] [-First <UInt64>] [-IncludeTotalCount] [<ConnectionOptions>] [<CommonParameters>]
Get-PSUJob -Schedule <Schedule> [-Status <JobStatus>] [-OrderBy <String>] [-OrderDirection <OrderDirection>] [-HideChildren <Boolean>] [-HideScheduled <Boolean>] [-HideTriggered <Boolean>] [-HideArchived <Boolean>] [-Skip <UInt64>] [-First <UInt64>] [-IncludeTotalCount] [<ConnectionOptions>] [<CommonParameters>]
```

`<ConnectionOptions>`: `[-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]`.

## DESCRIPTION

Lists jobs or retrieves a job by ID or run ID. `-Id` looks up related parent and child jobs unless `-HideChildren $true` suppresses children. `-RunId` requires the JobRunId feature. List queries support PowerShell paging, status, and ordering. In the current implementation `-HideArchived` is applied to `-Identity`, `-Script`, and `-Schedule` list queries, but not to the default all-jobs listing. Although the `-Schedule` parameter is accepted, its list-query implementation does not currently apply a schedule filter.

## EXAMPLES

```powershell
Get-PSUJob -RunId 'a1b2c3d4-1111-2222-3333-444455556666'
Get-PSUScript -Id 4 | Get-PSUJob -HideArchived $true
```

## PARAMETERS

| Parameter                | Description                                                                                                         |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------- |
| `-Id`                    | Retrieves a job by numeric ID.                                                                                      |
| `-RunId`                 | Retrieves a job by run GUID.                                                                                        |
| `-Identity`              | Lists jobs for an identity; accepts pipeline input.                                                                 |
| `-Script`                | Lists jobs for a script; accepts pipeline input.                                                                    |
| `-Schedule`              | Accepts a schedule object via pipeline; the current list query does not filter by schedule.                         |
| `-Status`                | Filters list queries by status.                                                                                     |
| `-OrderBy`               | Orders lists by `Id`, `StartTime`, or `EndTime` (default `Id`).                                                     |
| `-OrderDirection`        | Selects sort direction for list queries.                                                                            |
| `-HideChildren`          | Suppresses child jobs (`$true`); applies to lists and detail lookups.                                               |
| `-HideScheduled`         | Excludes scheduled jobs from lists when `$true`.                                                                    |
| `-HideTriggered`         | Excludes triggered jobs from lists when `$true`.                                                                    |
| `-HideArchived`          | Excludes archived jobs when using `-Identity`, `-Script`, or `-Schedule`; not applied to the default all-jobs list. |
| `-Skip`                  | Skips this many jobs when paging a list.                                                                            |
| `-First`                 | Returns up to this many jobs when paging a list.                                                                    |
| `-IncludeTotalCount`     | Emits the total number of matching jobs for a paged list.                                                           |
| `-ComputerName`          | Target PSU server URL or host name (alias `-Uri`).                                                                  |
| `-AppToken`              | App token for the Management API.                                                                                   |
| `-Credential`            | Credentials for the Management API.                                                                                 |
| `-UseDefaultCredentials` | Uses current Windows credentials.                                                                                   |
| `-Integrated`            | Uses the in-process management client inside PSU.                                                                   |
| `-TrustCertificate`      | Ignores certificate validation errors.                                                                              |
| `-Cookies`               | Reuses authentication cookies for this PowerShell session.                                                          |

## PERMISSIONS

Listing or filtering jobs requires `automation.jobs/read`. Reading one job by `-Id` or `-RunId` requires `automation.jobs.<job ID>/read` for the requested job and any returned parent or child jobs. A matching custom ReadPermission on the job can also authorize detail access.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.devolutions.net/powershell-universal/powershell-commands/get-psujob.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
