2

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 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?

Community
  • 1
  • 1
mnaoumov
  • 2,146
  • 2
  • 22
  • 31
  • 2
    May I ask you why you need version 2.0 on .net 4.0 and not using directly version 3 (.net 4 native) ? – CB. Oct 18 '12 at 09:05

1 Answers1

0

It seems that the 64-bit version of PS doesn't support version 2. On windows 8 64-bit, you need to run the 32-bit version.

This runs the 64-bit version, which doesn't support 2.0 (BAD):

%systemroot%\System32\WindowsPowerShell\v1.0\powershell.exe -version 2.0

This runs the 32-bit version (GOOD!):

%SystemRoot%\syswow64\WindowsPowerShell\v1.0\powershell.exe -version 2.0
Jon Wagner
  • 667
  • 4
  • 6