question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't find powershell.exe

See original GitHub issue

Hi,

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:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dacmotcommented, Jul 22, 2022

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!

0reactions
hero101111commented, Jul 22, 2022

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?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found