Windows PowerShell Home
-Version 2.0 still loads a V3 shell when configured to use the 4.0 CLR
4/26/2013 6:06:43 AM
User(s) can reproduce this bug
When I had powershell V2, in order to load .NET 4.0 assemblies I had to create a powershell.exe.config file that looked like this:
After upgrading to powershell/WMF V3, when I try to get a backward compatible V2 shell using the -version 2.0 parameter, I still get a V3 shell. It turns out that it's because of that configuration file I need in V2 -- if I delete that file I can get a V2 shell, but I can't load CLR 4.0 assemblies.
This wouldn't be a big deal if all of my old V2 scripts worked in V3 - but some of them (eg. those that use the IIS WebAdministration module or Set-Acl) require a V2 shell.
How often does this happen?
Have you seen this problem before in this product?
No, this is new to the most recent version
- create a powershell.exe.config that allows powershell to load CLR 4.0 assemblies
- run powershell -version 2.0
- run Get-Host
- Assembly.Load a CLR 4.0 assembly
Expect Version: 2.0 shell and the ability to load a CLR 4.0 assembly
Actual Version: 3.0 shell
to post a comment.
Please enter a comment.
to post a workaround.
Please enter a workaround.
© 2014 Microsoft