Home Dashboard Directory Help
Search

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


Status: 

Active


1
0
Sign in
to vote
Type: Bug
ID: 785672
Opened: 4/26/2013 6:06:43 AM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

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:

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

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