Forum Discussion
pwsh.exe Not recognized, even after adding path?
mine is vice versa
PS C:\Windows\System32> powershell --version
The application to execute does not exist: 'C:\Windows\System32\pwsh.dll'.
PS C:\Windows\System32> pwsh --version
PowerShell 7.4.3
PS C:\Windows\System32>
Any clue how to fix it?
There's not enough information to know your starting position, and the error from the first command doesn't make sense to me, as pwsh.dll doesn't live in %windir%\System32 by default - at least not under PowerShell v7 and above (and it doesn't relate at all to Windows PowerShell).
Do you get anything back from running the following from a command prompt?
%windir%\System32\WindowsPowerShell\v1.0\powershell.exe -Command "[PSCustomObject] $PSVersionTable | Select-Object -Property PSVersion, PSEdition"
Example output
As an aside, "powershell --version" is an invalid command when referencing Windows PowerShell, and it's not the same at all as "pwsh --version". But that's unimportant in the context of the error you received.
Cheers,
Lain
- felixozunaJul 12, 2024Copper ContributorHi Lain , I appreciate your help, my powershell is fine as a matter of fact I've been researching the internet all over to find a solution to a problem that I am getting in Flutter I don't know if your familiar or not but thats how this issue started because the error reads like this [!] Windows Version (Problem detected with Windows
installation)
! Get-Process failed to complete
But thats on my text editor terminal because when I run Get Process on the actual Powershell Terminal it runs fine! Ive already checked all my paths and I even created a batch file to route back pwsh but I dont know , I guess I'll have to make more research, Thanks Anyway!- LainRobertsonJul 12, 2024Silver Contributor
No problem.
Purely as a point of reference, I only have two path inclusions (in the system "path" variable) on my machine, where the first is from the per machine installation of PowerShell, and the second is from the out-of-box Windows PowerShell:
Given this thread started in the context of Windows Home, which I'm unfamiliar with, I have to point out that the above screenshot pertains to Windows 10 Enterprise (64-bit), meaning user of Home may or may not see the same output.
Cheers,
Lain