Home > Powershell > Installing Powershell v2 CTP 3

Installing Powershell v2 CTP 3

I’ve recently made a commitment to myself to learn Powershell.   What began with the necessity to learn Powershell basics in order to teach it as part of the MCITP:Server Adminstration track quickly evolved into a growing collection of index cards and a morning regiment of Powershell commands.  I even posted a blog article recently on using the Get-Eventlog cmdlet which I now incorporate into any class which even remotely mentions the Windows event logs in passing.  Well it’s not like the Tech Cafe couldn’t use the hits….:)

It seems that at times my collection of index cards is surpased only by the many IE Favorites I’ve seemed to compile over the last several weeks alone.  Long Live the Internet…. Everything from Technet Virtual Labs, personal blogs, videos and let’s not forget the Microsoft newsgroups.  It seems the first few hours of my day are consumed with all things Powershell.  Although progress is slow I manage to mainain a steady pace forward…Even a turtle manages to gets to it’s destination given enough time…

I was recently watching a video posted by Jason Helmick on installing Powershell v2 CTP 3 (Community Technology Preview).  Powershell v2 offers some additional cmdlets and is the version or choice for professional scripters or newbies alike (including your truly).  The CTP 3 version requires that some prerequisite software be installed such as:

  • .Net 2.0
  • WinRM 2.0 CTP3
  • .Net 3.5.1

.Net 3.5.1 also requires that, once it’s installed,  the following hotfixes also be installed in the following order

  1. KB958481
  2. KB958483
  3. KB958484

How could it be that installing a new version of Powershell could be so complicated and time consuming?  Either way it’s something I needed to do if I was ever going to start using the new version.  Now  to complicate matters even more I’m constantly being distracted by one of my many other ongoing projects or my 2 yr old son (he’s just to cute to ignore)…oh did I forget to mention that this thing called “life” always seems to get in the way as well.   All of this produces a state of “hmmm” what was the last thing I did?   

Recently I was in the process of installing the prereq’s, got distracted and when I returned wasn’t quite sure if any of the KB’s had been installed.  So considering I was already in Powershell I decided to run the Systeminfo command.  Along with some system information it also displays a list of installed hotfixes.  Now 3 hotfixes might not seem like much to look for but when the list contains 20 or 30 then it can be hard on the eyes and trying on the patience.   And besides systeminfo isn’t even a Powershell command so I wouldn’t allow it to be an option.

How best then to parse through this information?  I did my usual google search and found a couple of sites that offered scripts or partial code to get me closer to my goal.   The first site I found was Tim Mintner’s Blog which included the following code.

$wu = new-object -com “Microsoft.Update.Searcher”

$totalupdates = $wu.GetTotalHistoryCount()


Although this displayed a list of installed updates the information was just too much.  I decided to parse it by title by using the  group-object cmdlet as follows:

$wu.QueryHistory(0,$totalupdates) | group-object title

This removed most of the non-essential info but it wasn’t enough.  I even tried using the sort-object cmdlet but that just organizes the info by title:

$wu.QueryHistory(0,$totalupdates) | group-object title | sort-object name

So I decided to post the code and questions into the Microsoft.Public.Windows.Powershell forums and see if I could leverage thier support.  My post is titled “Search for installed patches” and was posted on 12/30/2009.  Within the 8 hours since it was posted I’ve gotten a response from Marco Shaw (MVP) who has asked for additional information. 

Not only will posting future questions on the Microsoft Powershell forum assist with learning to create scripts but it also provides an opportunity to see just how people are using Poweshell to accomplish everyday tasks. 


Jason Helmick’s Blog

Tim Mintners’s Blog

Systeminfo – Technet


Categories: Powershell
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: