Docker unknown shorthand flag: 'a' in -aq)

Solution 1:

You can also run your command - docker stop $(docker ps -aq) in PowerShell or Git Bash; I would think the command fails because the $(docker ps -aq) part of the command is Linux command and windows CMD does not know how to translate that.

Solution 2:

In your Windows shell, you can do:

FOR /f "tokens=*" %i IN ('docker ps -q') DO docker stop %i

Taken from other question: Stop all docker containers at once on Windows