Is it possible to run powershell passing it the version of the .NET CLR we require?
Systems using Powershell V2 use CLR version 2 by default, and we need version 4.
We could implement a configuration file to:
- C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe.config
- C:\Windows\System32\WindowsPowerShell\v1.0\PowerShellISE.Exe.config
- C:\Windows\SysWOW64\WindowsPowerShell\v1.0\PowerShell.exe.config
- C:\Windows\SysWOW64\WindowsPowerShell\v1.0\PowerShellISE.exe.config
Like this:
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0.30319"/>
<supportedRuntime version="v2.0.50727"/>
</startup>
</configuration>
But we don't want make changes on customers servers which may potentially break other programs which rely on PowerShell.