I am writing a scrip that checks docker on remote systems. Running one of the docker commands I get an error in Powershell but the command runs fine from a Linux terminal and from a Cyqwin terminal on the Windows system. Any ideas what the issue could be?
Since they are both connecting to the same remote system the command should run exactly the same. I assume it has something to do with how Powershell is passing the command over ssh but I have no idea what it could be changing.
From Powershell
PS H:\> ssh -q docker@192.168.169.50 'docker node ls --format "{{.Hostname}}, {{.Status}}, {{.Availability}}, {{.ManagerStatus}}"' ssh : "docker node ls" accepts no argument(s). At line:1 char:1 + ssh -q docker@192.168.169.50 'docker node ls --format "{{.Hostname}} ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: ("docker node ls" accepts no argument(s).:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError See 'docker node ls --help'. Usage: docker node ls [OPTIONS] List nodes in the swarm
From Cygwin terminal on the same system:
user > ssh -q docker@192.168.169.50 'docker node ls --format "{{.Hostname}}, {{.Status}}, {{.Availability}}, {{.ManagerStatus}}"' borderlands-i.mycorp.com, Ready, Active, Leader borderlands-ii.mycorp.com, Ready, Active,
And without the --format option:
From Powershell:
PS H:\> ssh -q docker@192.168.169.50 'docker node ls' ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS g1s0x1u513fuqzt9rdte0zd0g * borderlands-i.mycorp.com Ready Active Leader mgspjfuwog9cp29zleh6wzzfs borderlands-ii.mycorp.com Ready Active
From Cygwin on the same system:
user > ssh -q docker@192.168.169.50 'docker node ls' ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS g1s0x1u513fuqzt9rdte0zd0g * borderlands-i.mycorp.com Ready Active Leader mgspjfuwog9cp29zleh6wzzfs borderlands-ii.mycorp.com Ready Active