-Version 2.0 still loads a V3 shell when configured to use the 4.0 CLR - by wbradney

Status : 


Sign in
to vote
ID 785672 Comments
Status Active Workarounds
Type Bug Repros 0
Opened 4/26/2013 6:06:43 AM
Access Restriction Public


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:

     <startup useLegacyV2RuntimeActivationPolicy="true">
         <supportedRuntime version="v4.0.30319"/>
         <supportedRuntime version="v2.0.50727"/>

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.
Sign in to post a comment.