What’s the Difference in Running Commands on Windows 10 vs. Windows 11?

0
13
Asked By CuriousCoder42 On

Hey everyone, I've been trying to port a script from Windows 10 to Windows 11, and I'm running into a weird issue. The script runs some executables, and even though it doesn't specify a path, it works fine on Windows 10. I can also execute these commands without a hitch in PowerShell on Windows Terminal. Here's the PowerShell version info for Windows 10:

PSVersion 5.1.19041.6093

But on Windows 11, when I try to run the same executable, I get this error: 'plink: The term 'plink' is not recognized as the name of a cmdlet...' The command works if I prefix it with '.', which leads me to wonder if something changed in PowerShell with Windows 11. Here's the version info for Windows 11:

PSVersion 5.1.26100.4768

I'd love to know why this difference is happening and if it's a change in the Windows 11 PowerShell!

3 Answers

Answered By ScriptingSage88 On

PowerShell has always required that you use the '.' prefix to run executables directly from the current directory. It's likely that your Windows 10 environment had the folder containing 'plink' in the `$env:path`, which allowed you to run commands without specifying the path. That's how commands like 'cmd' and 'ping' work too.

Answered By TechieJane45 On

Just so you know, Windows 11 actually comes with OpenSSH built-in, so you don't even need 'putty' or any other SSH client. However, if you do have existing keypairs from putty, you'll need to convert them since it uses a proprietary format.

CuriousCoder42 -

Oh, I'm in the process of switching vendors that use my script—one still on Windows 10 and one moving to Windows 11—so I'll have to keep it compatible for now.

Answered By ScriptMaster90 On

If you're having issues, make sure you have 'plink.exe' installed correctly or add its path to your user or system environment variables. This isn't necessarily a win10/win11 issue, more about how executables are referenced in PowerShell.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.