OpenSSH folder exists, but PowerShell does not see it
When I use PowerShell ISE, the command prompt or even Windows Explorer, the C:\Windows\System32\OpenSSH folder shows up fine.
However, if I open the regular PowerShell (it does not matter whether it is run as administrator or not) and try to go to the same directory, I can see everything in C:\Windows\System32, but the OpenSSH folder itself is not there.
Why is this happening and how can I fix it?
Answers
Karl Hoffmann
(Edited)
In some Windows versions, the OpenSSH component is installed only for the main (64‑bit) system, but not for the WOW64 subsystem.
Check whether the package is present in both environments using the following command:
If you only get a result in one of the PowerShell instances (32‑bit or 64‑bit), install the module manually:
After a restart, the system usually synchronises the paths and the folder becomes visible in both versions of PowerShell.
Lucas Neumann
(Edited)
I checked both versions — the OpenSSH client turned out to be installed in both. In my case, the problem was exactly that I was launching the wrong PowerShell version, just as Jürgen wrote above.
But your advice is still useful — I did not know about this command for checking Windows components. I am sure it will help someone if OpenSSH really turns out not to be installed. Thanks!
Jürgen Albrecht
(Edited)
Looks like a 32‑bit vs 64‑bit issue.
PowerShell ISE and Windows Explorer usually run as 64‑bit applications, while you are probably starting the 32‑bit version of PowerShell (or the other way round).
When a 32‑bit application is started, the C:\Windows\System32 folder is actually redirected to C:\Windows\SysWOW64 by the File System Redirector mechanism.
Because of this, a 32‑bit application sees a different set of system folders. Most likely, the OpenSSH folder is installed only in the 64‑bit variant.
Try launching PowerShell directly from this path:
Lucas Neumann
(Edited)
Exactly! Once I started the 64‑bit version, the folder appeared straight away. I did not even think about the bitness, but now it all makes sense.
I changed the shortcut on the desktop so that it opens the 64‑bit PowerShell by default, and now the ssh commands work without any issues. Thanks a lot for the hint!