Can't find powershell.exe
See original GitHub issueHi,
I just installed clang power tools. Clang format works great, but when I run compile or tidy, I get the same error :
--- CLANG TIDY STARTED ---
PowerShell.exe : The term 'PowerShell.exe' is not recognized as the name of a cmdlet, function, script file, or
operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ PowerShell.exe -ExecutionPolicy Unrestricted -NoProfile -Noninteracti ...
--- CLANG TIDY FINISHED ---
I don’t think it’s a power tool problem, but I’m running out of things to try to resolve this.
I’m running :
- Windows 10, 21H2
- Visual Studio 2017, 15.9.45
- Powershell 5.1.19041.1682
- CPT 9.0.0.958
PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
I tried opening Visual Studio as administrator, as well as a regular user. I am able to start powershell from a VS2017 developer command prompt, as well as with a regular command prompt. C:\Windows\System32\WindowsPowershell\v1.0\
is in my PATH. I tried installing Powershell 7 but it didn’t seem to help either.
Any tips and steps to try and fix this would be greatly appreciated. Thank you.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Fix: Windows Cannot Find Powershell.exe
What to Do If Windows Cannot Find Powershell on Your PC ; Go to This PC and navigate to C:\Windows\SysWOW64. Scroll down to...
Read more >Fix Windows cannot find Powershell.exe
Fix Windows cannot find Powershell.exe · 1] Check whether Windows PowerShell is Enabled · 2] Use Run Command or File Explorer to launch...
Read more >5 Ways to Fix It When Windows Cannot Find PowerShell.exe
5 Ways to Fix It When Windows Cannot Find PowerShell.exe · Press the Win + R keys to fire up the Run app....
Read more >How to fix "Windows cannot find Powershell.exe" error?
This error occurs when the system is unable to locate the PowerShell executable file (powershell.exe) needed to launch the program. This can ...
Read more >Windows Cannot Find PowerShell.exe: 5 Ways to Fix It
Press the Windows + R keys to open the Run command.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah! Great thinking. I forgot procexp could do that.
Indeed, it isn’t there. And I have an idea why. Something about my weird work setup.
Thanks!
Let’s investigate this a bit further…
Please grab Sysinternals Process Explorer and inspect the VS2017 process. Right click on it > Properties > Environment. You should see PATH listed there, copy and paste it somewhere where you can examine it. Does it look OK?