I've been using VSCode with a bit of GitHub and keeping another PowerShell window open since my monitor is small, making it easier to test scripts. But now, while playing around with some hastily written code, I noticed the PowerShell terminal in VSCode isn't behaving like my usual PowerShell windows. For instance, when I try to list the contents of the OpenSSH folder using `dir c:windowssystem32openssh`, it tells me the path doesn't exist, even though it does! And when I attempt to run `ssh.exe`, I get an error that it's unrecognized. In the regular Start menu PowerShell, everything works fine. I haven't modified any startup profiles and everything is running as the same user on the same machine. I'm really puzzled by this. Can anyone help me out?
4 Answers
Seriously though, why not switch to a better editor? Just kidding! On a serious note, it might be that the folder is hidden. Try using `dir -Force` to see if that's the case. For your `ssh.exe` problem, check your PATH by running `$env:Path -split ';'` to confirm it includes the directory where `ssh.exe` is located.
To fix the issue with `ssh.exe`, you might need to use the call operator `&` before it, like this: `&ssh.exe`, or specify the full path as `&c:windowssystem32opensshssh.exe`. Also, make sure that your paths are correctly set up by running `get-childitem -path c:windowssystem32 -directory` and checking if the OpenSSH path exists with `test-path -path c:windowssystem32openssh`. Additionally, check if you're running a 64-bit version of PowerShell with `[Environment]::Is64BitProcess`. If you're on a 32-bit version, that could cause issues. Don't forget about `sysnative` as well, which can help with accessing 64-bit from a 32-bit environment.
Just a heads-up, VSCode retains your PowerShell environment across sessions. If you've been using it for a while, your shell might have accumulated a lot of settings and junk. I usually clear out the terminal using the trash can icon to start fresh, which solves a lot of weird issues.
Are you sure you're using the 64-bit version of PowerShell? Sometimes having the wrong bit version can cause issues with finding executables.

That’s a great article, thanks for sharing!