PowerShell Not Your Father's Command Line Part 31 of 31: That’s a Wrap and We are Not Done Yet!

imageThank You, Thank You, Thank You, Thank you Thank You!  

I cannot say thank you to all of you following this series on the blog.  Thanks for the email, suggestions and most importantly thank you for your support.  Sarah and I greatly appreciate it and we could not have done it without you.  As Sarah mentioned in a few of her posts, community makes a difference!  So this marks the end of the 31 days of PowerShell and I thought I would end the series with a quick look new concept to PowerShell 2.0, that is jobs.  Specifically jobs allow you to run a PowerShell background job on the local computer.  Much like Sarah and I will be after this series is over, if you have an area you want to know more about or having trouble with let us know!

A Windows PowerShell background job runs a command "in the background" and you are returned to the shell immediately even if the job takes a long time to run.  This allows you to continue to work in PowerShell without being interrupted or having to wait.  To place a job in the background in a PowerShell session you will use the the Start-Job cmdlet.  To start a job in the background you would run Get-Service in the background:

Start-Job -scriptblock {Get-Service}

You can also use a a PowerShell Script in this cmdlet as well:

Start-Job –filepath <path to PowerShell script>

A side note if you want to start a job on another computer would use the AsJob parameter you will find with many cmdlets, or you could still also use the Invoke-Command (we saw that in Part 21 on remoting).    To see a list of PowerShell background jobs either started locally or remoting on your system you can use Receive-Job. Lastly, if you want to certain commands that may relate to a particular object you can use a little bit of wildcards to learn more.  To find the different cmdlets that work with the Job object you could run the following command:

Get-Command *Job

So what’s next.  I am going to take a look at even more uses for PowerShell.  Here are some future topics you may see on the blog in the upcoming Months:

  • SBS and PowerShell:   I am going to do some research and come up with some ideas on where PowerShell can provide some use to the SBS environments.
  • Azure, Office 365 and others:  I am going to take a look at upcoming different PaaS, IaaS and SaaS offerings and where PowerShell can help integrate and automate administration
  • What Do You Want To See: What topics do you want to see surrounding PowerShell from the IT Pro Perspective?

Again a huge thank you for everyone reading the posts on our blogs and thank you to everyone who has purchased the book.  If you have a copy of the book and you see Sarah and I on the street please come up and say hello.  Also if you want us to sign it, we would be happy to!  So for the last time in this series, thanks for reading and if you missed any of the previous posts you can find a master list of series postings located here: PowerShell Not Your Father's Command Line: 31 Days of PowerShell or on Sarah’s blog here: PowerShell Not Your Father's Command Line: 31 Days of PowerShell.