I’m running Windows 10 and a few weeks ago I managed to do something (in the middle of the night – can’t remember) such that I can’t open PowerShell (nor PowerShell ISE) with administrative rights anymore. When opening it via right-click -> as admin, the Shell opens and closes immediately. Opening without administrative rights works fine.
I managed to find the error through opening a
cmd as admin and typing the command "PowerShell". It says (translated):
"The type initializer for "System.Management.Automation.Runspaces.LocalRunspace" caused an exception"
Google seems not to come up with similar cases. Any suggestions?
Source: Windows Questions