Powershell can't even open notepad [duplicate]

Solution 1:

PowerShell still relies on the system PATH variable and the PATHEXE variable to resolve commands that execute a program, which describes which file extensions will be executed.

Some very bad software probably removed this environmental variable from my machine, so I've added it as default:

PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

Once I restore the system variable I was able to start Notepad from PowerShell