Contact Info

Crumbtrail » Administration » Powershell » Powershell 3.0 » Stop-Job

Stop-Job - Powershell 3.0 CmdLet

ActiveXperts Network Monitor ships with integrated Powershell scripts to monitor complex network. The scripts run out of the box
Download the ActiveXperts Network Monitor FREE version now »


Short description
Stops a Windows PowerShell background job.

Stop-Job [-Id] <Int32[]> [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
Stop-Job [-Filter] <Hashtable> [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
Stop-Job [-InstanceId] <Guid[]> [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
Stop-Job [-Job] <Job[]> [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
Stop-Job [-Name] <String[]> [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
Stop-Job [-State] <JobState> [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]

The Stop-Job cmdlet stops Windows PowerShell background jobs that are in progress. You can use this cmdlet to stop all 
jobs or stop selected jobs based on their name, ID, instance ID, or state, or by passing a job object to Stop-Job.

You can use Stop-Job to stop background jobs, such as those that were started by using the Start-Job cmdlet or the AsJo
b parameter of any cmdlet. When you stop a background job, Windows PowerShell completes all tasks that are pending in t
hat job queue and then ends the job. No new tasks are added to the queue after this command is submitted.

This cmdlet does not delete background jobs. To delete a job, use the Remove-Job cmdlet.

Beginning in Windows PowerShell 3.0, Stop-Job also stops custom job types, such as workflow jobs and instances of sched
uled jobs. To enable Stop-Job to stop a job with custom job type, import the module that supports the custom job type i
nto the session before running a Stop-Job command, either by using the Import-Module cmdlet or by using or getting a cm
dlet in the module. For information about a particular custom job type, see the documentation of the custom job type fe