my powershell in Win10 has become completely nonfunctional.
- If I try and execute a script it hangs on an empty shell window
- If I load Powershell (with and without Admin) it displays the copyright info but I can't type anything
- If I load the script into ISE the play button is greyed out but the stop button is active. If I press stop the play button remains grayed out. Also can't type into the ISE console window.
- Restarted several times, same problem
Anyone know what this could be?
12 Answers
Luckily had another Win10 box handy, was some Registry weirdness. HKEY_CLASSES_ROOT\Microsoft.PowershellScript.1\Shell\0\Command
Was: "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "-file" "%1"
Should have been: "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "-Command" "if((Get-ExecutionPolicy ) -ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass }; & '%1'"
5I found this trick in 2014 forum post: with the Powershell open press Ctrl+X then Ctrl+C. Worked for me.
2