PowerGUI Error: Microsoft SharePoint is not supported with version 4.0.30319.1 of the Microsoft .Net Runtime
PowerGUI is my favorite IDE for creating PowerShell scripts. When I upgraded PowerGUI to a newer version 3.5, all my scripts stopped working and I started receiving below error:
“Get-SPWeb : Microsoft SharePoint is not supported with version 4.0.30319.1 of the Microsoft .Net Runtime.”
Root Cause:
SharePoint cmdlets do not work with .NET framework 4! In PowerGUI’s configuration, We got to remove that!
Solution:
Open the “ScriptEditor.exe.config” file from the location where PowerShell GUI is installed. Typically, “C:\Program Files (x86)\PowerGUI\”.
Find the Line: ” <supportedRuntime version=”v4.0″ sku=”.NETFramework,Version=v4.0″ /> ” under “startup” node
Comment that line, Save & Close.
Now, Restart the Script Editor. All should be working now.