PowerShell 2.0: One Cmdlet at a Time 18 Remove-Job

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

What can I do with it?

Remove existing background jobs from the current session.

Examples:

Remove the job with ID 1.

Remove-Job -Id 1

Use the Get-Job cmdlet to retrieve all jobs and pipe it through to Remove-Job to remove them all.

Get-Job | Remove-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!