PowerShell 3 quick switch to PowerShell 2

2013/01/30 | By | Reply More

PowerShell 3 improves on PowerShell 2 by adding almost 500 new cmdlets built-in.  One drawback unfortunately, is cmdlets or scripts written for version 2 do not always work as expected.

If you need to quickly switch to version 2 while you are in PowerShell 3 type the following.

PowerShell.exe -version 2

You will see the copyright info change to 2009 and if you type get-host it will display version 2.

image

To switch back to version 3 you can either  close and re-open PowerShell or simply type in your current session

[sourcecode language=”powershell” padlinenumbers=”true” gutter=”false”]
PowerShell.exe -version 3

[/sourcecode]

image

Tags:

Category: Uncategorized

Leave a Reply

You must be logged in to post a comment.