Pcornel
Automation · PowerShell Automation

Jobs

Cheat sheet · https://pcornel.dk/topic.php?topic=5245

Back to the Topic

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.

Remember

  • Start-Job runs work in the background.
  • Receive-Job collects output.
  • Remove jobs when done.

First checks

  • Start-Job { … }; Get-Job; Receive-Job <id> — background jobs
  • Invoke-Command -AsJob -ComputerName <list> — remote jobs
  • Remove-Job -State Completed — cleanup

Verify in this order

job started → runs → results received

Where it usually breaks

Script/input → command/module binding → local/remoting session → request accepted → command result → target object read-back → effective runtime state → workload.

Jobs · PowerShell operational reference

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

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5245

Confirmation

Confirm action

Continue?