In Linux
ssh me@server "echo this ran remotely"
The output this ran remotely
is put to standard out. This is perfect.
In Windows
echo "echo this ran remotely" > test.cmd
putty -i privatekey.ppk -m test.cmd -ssh me@server
The output doesn't go to standard out, it opens in a new process and, as far as I can tell, is lost forever.
How do I capture the output of the remote command?
I know I can do it in cygwin, but that's not helpful because it's hard to run cygwin commands programmatically from other scripting languages.
ubuntu
command in windows (See the windows store for "Ubuntu")