Thursday, May 24, 2012

HOWTO: Determine the current Powershell version

Today me and one of my coworkers were investigating a problem related to configuration of a new server machine. We have an batch script which automates tasks like configuring the new OS, pulling from Git repos, building locally and setting up the local Web apps. At one of the steps, the script failed where it was executing a Powershell script. That could be due to mismatch of Powershell version. So here are my findings:

1. On Windows 7 and Windows 2008 Server R2 (and newer), Powershell 2.0 comes with the OS. On Vista, Windows 2008 Server, you have to manually install it

2. If you want to make sure what is your current PS version, open up a Powershell window and type “$Host.Version” at the prompt. You will see the following output showing the version number – in this case 2.0:

image

No comments:

Post a Comment