Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Jobs · PowerShell Automation

Direct answer

PowerShell jobs run commands in the background with Start-Job or -AsJob, checked with Get-Job and collected with Receive-Job, useful for long or parallel tasks.

When to use this

Use this when running PowerShell work in the background.

First 30 seconds

1. Jobs run work in the background.

2. Collect results with Receive-Job.

3. Check State and errors.

4. Clean up jobs.

5. ThreadJob is lighter.

Operational verification

job started → runs → results received

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
PowerShell 7.6/current
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformPowerShell 7.6/current · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when running PowerShell work in the background.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification path Verify boundary

Use Get-Job to inspect state, Wait-Job for completion and Receive-Job -Keep while diagnosing. Inspect child job states and all streams when a parent job is failed or partially complete. Verify any target mutation separately after the job reports completion; the job state alone does not show each workload result is correct.

Step 2 Common mistakes Narrow the fault
  • Jobs never received or removed.
Step 3 Where it fails Narrow the fault

A Completed job means its execution container reached completion, not that the business objective was achieved. Parent-session termination can affect access to non-persistent jobs, while remote disconnected scenarios have their own persistence rules. Separate job lifecycle, output retrieval, per-child errors and target-state read-back.

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Start-Job runs work in the background.
  • Receive-Job collects output.
  • Remove jobs when done.
Key checks
  • Start-Job { … }; Get-Job; Receive-Job <id> — background jobs
  • Invoke-Command -AsJob -ComputerName <list> — remote jobs
  • Remove-Job -State Completed — cleanup
ReferenceWhy it matters1 section · depth on demand

In depth

PowerShell jobs run commands in the background while the session continues, useful for long tasks or running several tasks at once. Thread jobs are lighter and faster than classic process-based background jobs.

CommandRuns in
Start-JobSeparate process (heavy, isolated)
Start-ThreadJobThread in the same process (fast)
Invoke-Command -AsJobRemote machines
ForEach-Object -ParallelRunspaces (PowerShell 7)
$jobs = 'srv01','srv02','srv03' | ForEach-Object {
  Start-ThreadJob -ArgumentList $_ { param($s) Test-Connection $s -Count 2 -Quiet }
}
$jobs | Wait-Job -Timeout 60 | Receive-Job
$jobs | Remove-Job -Force

Always collect results with Receive-Job and clean up with Remove-Job; errors inside jobs are only visible when receiving them.

ReferenceImportant terms & boundaries1 section · depth on demand

PowerShell mechanics

PowerShell jobs decouple command execution from the interactive pipeline. BackgroundJob runs work in a separate local process, RemoteJob represents remote execution, and ThreadJob/PSTaskJob runs in another thread/runspace in the same process. Job objects have lifecycle state plus buffered data streams; completion of the job container and retrieval of output with Receive-Job are separate operations.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceConfiguration & state1 section · depth on demand

Authoring and lifecycle

Choose job type according to isolation, serialization and overhead needs. Track job identifiers and child jobs, set explicit throttling outside the job layer where needed, and decide whether output must persist after the parent session exits. Receive and archive relevant streams before removal, because job repositories and parent-session lifetime affect what remains accessible.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical examples

Configuration & expected output

Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.

Configuration example

PowerShell 7.6/current 7.6/currentMinimal authored PowerShell pattern for Jobs

Assumptions: Review target identity, permissions and environment before mutation.

$job = Start-Job { Get-Date }
$job | Wait-Job | Receive-Job
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docPowerShell 7.6/current 7.6/current

Microsoft Learn documentation reviewed for bounded PowerShell reference claims. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_jobs?view=powershell-7.6 · confidence 94%
Embedded reference data

Quick lookup tables

Jobs · PowerShell operational reference

Topic-specific PowerShell runtime identity, persistence, verification, output and failure-boundary lookup.

BoundaryJobs reference
Runtime identityPowerShell edition/version + command/module source
Persistent intentScript/module/config prerequisites under source control
VerificationRead-only discovery → execution evidence → independent target read-back
Output contractStructured objects/streams before formatting
Failure boundarySeparate engine/binding from transport/API/native and target-state failures
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

Job output can be buffered until received and remote/background jobs can serialize objects. Multiple child jobs can finish in different orders, and a parent can aggregate mixed states. Inspect error and output streams per child when correlation matters instead of relying only on the parent status line.

Confirmation

Confirm action

Continue?