After reading several other blog posts and articles (references found below) there appear to be several ways to run PowerShell on .NET 4.0 but few are sufficient for our purposes. Due to how we deploy our software we cannot update the registry or change add an application. This leaves us with two options, create our own shell by using ConsoleShell
or override PSHost
. We would like to be able to use the first option, ConsoleShell
, due to it's simplicity but would like to know what issues we may encounter and whether doing so is recommended.
Reference
Based on other questions I have seen that you can use the following methods to run PowerShell as .NET 4.0. None of these methods appear to be officially sanction by Microsoft but the first shown below is included as a work around in this Microsoft connect issue.
The options to run PowerShell in .NET 4.0 appear to include:
- Update the app.config to include .NET 4.0 as supported
- Add a registry setting to switch the version
- Use
ConsoleShell
to host your own PowerShell Console - Implement your own PowerShell host,
PSHost
, as done by PoshConsole or Nuget