PowerShell 2.0: One Cmdlet at a Time 19 Stop-Job

Continuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Stop-Job cmdlet.

What can I do with it?

Stop background jobs which are running in the current session.

Examples:

Stop job with id 13.

Stop-Job -id 13

Retrieve all current jobs and stop them all.

Get-Job | Stop-Job

How could I have done this in PowerShell 1.0?

The concept of jobs did not exist in PowerShell 1.0. You would have needed to open an extra PowerShell session whilst you waited for a command to complete in your current session.

1000 things 1% better!