For the complete documentation index, see llms.txt. This page is also available as Markdown.

Get-PSUJob

SYNOPSIS

Retrieves jobs run within PowerShell Universal.

SYNTAX

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

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.

Last updated

Was this helpful?