NativeCommandError running remote command

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

Is this PSWin or PSCore?
What PS SSH client / add on are you using?

Using SSH with PowerShell https://www.thomasmaurer.ch/2016/04/using-ssh-with-powershell

Why are you not using the Docker module from here:

PowerShell Module for Docker

This repo contains a PowerShell module for the Docker Engine. It can be used as an alternative to the Docker command-line interface (docker), or along side it. It can target a Docker daemon running on any operating system that supports Docker, including both Windows and Linux

Quoting really matters in PowerShell, especially when calling external commands and exes.
Noted: even in your post, You are using single and double quotes in the one with variables, but in your other only using single quotes.

See also:

Docker for Windows cheat sheet https://stefanprodan.com/2016/docker-windows-powershell-cheatsheet

So, try this…

ssh -q docker@192.168.169.50 "docker node ls --format {{.Hostname}}, {{.Status}}, {{.Availability}}, {{.ManagerStatus}}"

I have no docket to test this on, but in my normal work using PS with say plink, I’ve not run into these sort of issues.
So, stuff like —

$GetIptablesNat = & $PlinkPath -load $linuxsession 'sudo -s iptables -L -nv --line-numbers -t nat';$GetIptablesNat 

— to my remote Linux boxes works 100%.