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.

The term 'C:\Windows\System32\OpenSSH\ssh.exe' is not recognized as the name of a cmdlet, function, script file, or operable program.

See original GitHub issue

Steps to reproduce

Seems only ssh.exe and wsl.exe will have this weird problem. Even I use a full path like C:\Windows\System32\OpenSSH\ssh.exe wont fix the problem. See following screenshots.

Expected behavior

With Windows PowerShell, everything works as expected. image

Actual behavior

With PowerShell Core image

Environment data

Installed with PowerShell-7.0.0-rc.2-win-x64.msix

Name                           Value
----                           -----
PSVersion                      7.0.0-rc.2
PSEdition                      Core
GitCommitId                    7.0.0-rc.2
OS                             Microsoft Windows 10.0.19041
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

14reactions
mklement0commented, Feb 5, 2020

I see: I’m starting to suspect that it is PowerShell that has been installed as a 32-bit version, which would explain the symptom, given that 32-bit processes have their own, independent C:\Windows\System32 directory that shadows the one that 64-bit processes see.

Try:

# This would only work from a 32-bit PowerShell instance.
# Access the 64-bit C:\Windows\System32 directory.
Get-Item -Force C:\Windows\SysNative\OpenSSH\ssh.exe

A quick test to determine whether your PowerShell session is 32-bit is to examine $env:ProgramFiles: if it contains C:\Program Files (x86) instead of C:\Program Files, you’re running a 32-bit session.

3reactions
cloudhancommented, Feb 6, 2020

@mklement0 Great thanks for the help, problem resolved after I reinstalled x64 version. Seems I make some mistake and install x86 version, and I can confirm that with my command history. Also thanks for pointing out the interesting SysNative directory.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The term 'ssh' is not recognized as the name of a cmdlet ...
The term 'ssh' is not recognized as the name of a cmdlet, function, script file, or operable program. I have followed the tutorial...
Read more >
How To Fix 'the term is not recognized as the name of a ...
If that module is missing, corrupt, or got moved, it throws up the error, “the term is not recognized as the name of...
Read more >
The term '...' is not recognized as the name of a cmdlet
Hi, I am new to PowerShell. I am running on Win7 and I have the following module installed. I constantly hit with error:...
Read more >
The Term Is Not Recognized as the Name of a Cmdlet, ...
This article teaches you how to fix the PowerShell error: "The term is not recognized as cmdlet, function, script file, or operable program....
Read more >
[Fix] The term 'scriptcs' is not recognized as the name of a ...
... guide on how to fix the error "The term 'scriptcs' is not recognized as the name of a cmdlet, function, script file...
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