Using PowerShell 2.0 with .NET Framework 4.0 is not supported. This is due to some changes in the runtime activation policy of CLR 4 which prevent applications built against CLR 2 from automatically rolling forward to CLR 4. More details about these changes are described in the "In-Process Side-by-Side" article in MSDN Magazine at http://msdn.microsoft.com/en-us/magazine/ee819091.aspx.
While it is possible to force PowerShell 2.0 to run with .NET Framework 4.0 using various mechanisms such as creating a config file for PowerShell or editing the registry, these mechanisms aren't supported and can have negative side effects on other PowerShell functionality such as PowerShell remoting and cmdlets with mixed-mode assemblies.
We've added support for .NET Framework 4 in Windows PowerShell 3.0. If you cannot take a dependency on Windows PowerShell 3.0, then you should continue to use .NET Framework 2.0 or 3.5. If you have a hard dependency on .NET Framework 4 for creating cmdlets, scripts, hosts, etc., you will need to use Windows PowerShell 3.0.
Users browsing this forum: No registered users and 1 guest