I have Powershell 3 installed on my box.
I need to test some scripts with Powershell 4 but I want to continue to run some of my scripts that are tested under Powershell 3 and I do not want to break something by installing Powershell 4.
QUESTION:Is it possible to open a Powershell sessions under Powershell version 3 (or even 2 if needed) despite I have installed Powershell 4?
When you have the Windows Management Framework Core 4.0 package installed, you can run PowerShell version 2.0, but not 3.0. Use the -version 2.0 parameter to launch PowerShell v2.
See this TechNet article: http://technet.microsoft.com/en-us/library/hh847899.aspx
Also see the help about_powershell.exe help documentation: http://technet.microsoft.com/en-us/library/jj553275.aspx
Yes. Starting with V3, you could open a powershell session for a downlevel version using the -Version parameter.
-Version
Starts the specified version of Windows PowerShell.
Enter a version number with the parameter, such as "-version 2.0".
So running
Powershell.exe -Version 2
will start a session that can be used to run/test a V2 script.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With