PowerShell Genie

Start-Job

Use Start-Job to run a script block in a separate background process and return a job object immediately.

Command 2 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn — PowerShell module reference

Syntax

1PS> Start-Job [-ScriptBlock] <ScriptBlock> [-Name <String>] [-ArgumentList <Object[]>] [-InitializationScript <ScriptBlock>] [-Credential <PSCredential>] [<CommonParameters>]
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.

Start-Job [-ScriptBlock] <ScriptBlock> [-Name <String>] [-ArgumentList <Object[]>] [-InitializationScript <ScriptBlock>] [-Credential <PSCredential>] [<CommonParameters>]
  1. Stage 1Start-Job-ScriptBlock -Name -ArgumentList -InitializationScript -Credential

    Try it

    Windows PowerShell

    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.

    Interactive simulation · fictional data

    Examples

    Filter by Status

    1PS> Start-Job -Name check -ScriptBlock { Get-Service | Where-Object Status -eq 'Running' } | Select-Object Id, Name, State
    Show reference output

    Sample output · fictional data, shaped like the real thing

    Id  Name      State
    --  --------  -----
        BITS
        Dnscache
        WinRM

    Start-Job -ScriptBlock {

    1PS> Start-Job -ScriptBlock { param($n) "looking at $n" } -ArgumentList 'spooler' | Select-Object Id, State
    Show reference output

    Sample output · fictional data, shaped like the real thing

    Id  Name  State    HasMoreData  Location
    --  ----  -----    -----------  --------
    1   Job1  Running  True         localhost

    Start-Job -ScriptBlock { (2)

    1PS> $job = Start-Job -ScriptBlock { Get-Date }; Wait-Job $job | Out-Null; Receive-Job $job
    Show reference output

    Sample output · fictional data, shaped like the real thing

    Thursday, September 10, 2026 11:47:12 PM

    Parameters

    Parameter definitions:

    • -ScriptBlock
    • -Name
    • -ArgumentList
    • -InitializationScript
    • -Credential

    PowerShell module reference on Microsoft Learn

    Practical use and troubleshooting

    Practical scenario: Use Start-Job when you need to run a script block in a separate background process and return a job object immediately. 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 command available interactively may be missing inside a job. Import required modules and pass needed inputs in the job script; do not assume the parent session's variables are automatically present. 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: Start-ThreadJob. Start-Job uses a separate process; Start-ThreadJob uses threads in the current process. Process jobs serialize results, while thread jobs share a process and its failure boundary. Read the linked command before substituting it; similar names do not imply identical inputs or output.

    Start-Job reference on Microsoft Learn

    Recap

    Start-Job Use Start-Job to run a script block in a separate background process and return a job object immediately.

    Next: Start-ThreadJob
    Genie guideStart-Job

    Use Start-Job to run a script block in a separate background process and return a job object immediately. The console below is pre-loaded — run it, then change a value and run it again.