Home Dashboard Directory Help
Search

PowerShell 2.0 with .NET 4.0 on Windows 8 by Michael Naumov


Status: 

Active


6
0
Sign in
to vote
Type: Bug
ID: 767907
Opened: 10/18/2012 1:25:50 AM
Access Restriction: Public
0
Workaround(s)
view
1
User(s) can reproduce this bug

Description

Windows 8 has PowerShell 3 installed

If I need to get PowerShell 2 I am using

    PowerShell.exe -Version 2

But this runs against .NET CLR 2.0

I want to use .NET CLR 4.0

I tried all approaches from http://stackoverflow.com/questions/2094694/how-can-i-run-powershell-with-the-net-4-runtime

But I apply any of them and then

    PowerShell.exe -Version 2

It will actually load PowerShell 3.
To check this type

    $host.Version

Is this a bug?
Details
Sign in to post a comment.
Posted by Dan Händevik on 3/14/2013 at 11:19 AM
I have the same issue.
Running powershell x86 (C:\Windows\SysWOW64\WindowsPowerShell\v1.0)

powershell.exe
starts powershell v3, clr 4

powershell.exe -version 2
starts powershell v2,clr 2

Adding a config file (powershell.exe.config) and specifying the supportedRuntime to clr 2
Here both commands starts a powershell v3,clr4
Sign in to post a workaround.