Advanced Windows PowerShell Scripting Video Training

Advanced Windows PowerShell Scripting Video Training
Advanced Windows PowerShell Scripting Video Training

Wednesday, October 15, 2014

How to set PowerShell to Always Open in Version 2

One of the things that I love most about being an MCT is that I get to meet a lot of people who look at things differently.  For example, in my PowerShell class this afternoon, I had one individual ask if it was possible set PowerShell to open in V2 by default. They were in a mixed environment between V2, 3, and 4. My first instinct was to add this line to their PowerShell profile. 

PowerShell -Version 2

Then I thought about it.  I would much rather have version 5 as my default and just create a different icon for version 2.  So this is what I did.

Right click your desktop and select New –> Shortcut.

In the Type the location of the Item: box, enter PowerShell.exe –Version 2 and click Next

image

In the Type a name for this shortcut box, I gave the name PowerShell V2 and clicked Finish.

image

I then opened the icon that it created.

image

When you type Get-Host the Version property should show that you are using V2.  If you want to switch to V5 in this windows, just type PowerShell –Version 5 and press Enter.

No comments: