Scripting. Powershell, VMware, Windows, Active Directory & Exchange. All that kind of stuff…..
RSS icon Email icon Home icon
  • PowerShell 2.0: One Cmdlet at a Time #19 Stop-Job

    Posted on December 14th, 2009 Jonathan Medd No comments

    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

    Stop-Job

    Retrieve all current jobs and stop them all.

    Get-Job | Stop-Job

    Stop-JobAll

    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!

    Leave a reply