Reputation: 7243
I've read the whole thread about running PowerShell under .NET 4.0, including the warnings about what happens when using the registry keys to make the scripts run under that framework.
So far, I only get the desired result with the registry keys. Is anyone aware of a way to make this work without changing the registry keys? When I checked PowerGUI's discussion boards, even they pointed to the stackoverflow thread. Has anyone come up with something better since April 2010?
Upvotes: 1
Views: 2152
Reputation: 41
1- Go to: "C:\Program Files (x86)\PowerGUI" and create a "ScriptEditor.exe.config" file.
2- Paste this xml in the file
<?xml version="1.0"?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0.30319"/>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>
3- Enjoy
This way, your change won't alter the whole machine.
Upvotes: 4
Reputation: 201922
RE "something better" - short of PowerGUI being recompiled to target .NET 4.0 - no. Out of curiousity, what .NET 4.0 feature are you trying to access in .NET 4?
Upvotes: 1
Reputation: 126892
I'm not a dev but maybe you create a config file for powergui. Check this page:
Upvotes: 0