Get-Job
Use Get-Job to list the jobs in the session with their current state.
Documentation: Microsoft Learn — PowerShell module reference
Syntax
See the command anatomy
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Get-Job [[-Id] <int32[]>] [-Name <String[]>] [-State <JobState>] [-HasMoreData <Boolean>] [-Command <String[]>] [-IncludeChildJob] [<CommonParameters>]- Stage 1Get-Job
-Id -Name -State -HasMoreData -Command -IncludeChildJob
Try it
PowerShell example · browser support is limited.
Execution scope: The full example below requires PowerShell outside this browser. You can edit this runner to use the supported practice commands; unsupported syntax returns an explanation.
Follow the objects
Run the command to inspect each stage.
Examples
Select Id, Name, State, HasMoreData
Show reference output
Sample output · fictional data, shaped like the real thing
Id Name State HasMoreData -- ---- --------- ----------- 1 Job1 Completed True 3 Job3 Running True
Get-Job -State Failed
Show reference output
Sample output · fictional data, shaped like the real thing
Id Name State -- ---- ----- 2 Job2 Failed
Expand ChildJobs
Show reference output
Sample output · fictional data, shaped like the real thing
Id State -- ----- 2 Completed 4 Running
Parameters
Parameter definitions:
-Id-Name-State-HasMoreData-Command-IncludeChildJob
Practical use and troubleshooting
Practical scenario: Use Get-Job when you need to list the jobs in the session with their current state. Review syntax and sample output, then try an example in the browser lab. Start with one identified target and inspect the returned values before extending the operation to a list. Keep the identity in your report so you can trace each result back to the object or path that produced it.
Common error and fix: A missing job can mean the query is running in another PowerShell session. Keep the job object returned by the start command or inspect IDs in the session that created it. In an unattended script, capture this failure with its original error record and record which target failed. An empty result and an unsuccessful query must remain distinguishable in the final report.
See also: Receive-Job. Get-Job returns job metadata such as State; Receive-Job retrieves a job's output. Inspecting a Completed state is not the same as collecting its results. Read the linked command before substituting it; similar names do not imply identical inputs or output.
Recap
Get-Job Use Get-Job to list the jobs in the session with their current state.
Next: Get-ScheduledTask