> when I'm trying to run in external window, I get this exception It is not just an external window. It is a window of a real Microsoft PowerShell console. And Microsoft PowerShell 2.0 console does not work with .NET 4. The one that does work is Microsoft PowerShell 3.0 console. I suppose that your different server (where this is working fine) has PowerShell 3.0 installed. So you can either use PowerShell 3.0 or try to find some way to run Microsoft PowerShell 2.0 console with .NET 4.