I knew about this quite some time already, but never had time and apettite to do this change. Finally today I decided to use Powershell v4.0 in my Orchestrator dev environment in order to use all its wonderful features.
We need to configure system registry, so the change is applied to all applications (using .NET). Let’s do it…
Within the registry editor, navigate to:
For 64-bit apps:
For 32-bit apps:
And add a new DWORD named OnlyUseLatestCLR and it’s value 1. If you want to do it for both 32/64bit, you need to add this key on both places.
If you want to configure only Powershell (this will not apply to Orchestrator)
Within the $pshome directory (there are 2, one for 32bit and another one for 64bit), create a new file named powershell.exe.config and insert following content:
<?xml version="1.0"?> <configuration> <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0.30319"/> <supportedRuntime version="v2.0.50727"/> </startup> <runtime> <loadfromremotesources enabled="true"/> </runtime> </configuration>
Default paths for $pshome:
Cool, isn’t it? Let me know whether this worked in your environment.