In Unix or PowerShell, it’s possible to embed commands within commands like this:
docker rm $(docker stop $(docker ps -a -q --filter='name=mycontainer'))
But in a cmd shell, there’s no simple equivalent.
(The “for /f … (‘command’) … do …” construct is overly complex, and practically impossible to use for a two-level embedding like in the example above!)
To avoid that limitation, it’d be nice if docker could optionally get its arguments from standard input. Ex:
docker ps -a -q --filter="name=mycontainer" | docker stop - | docker rm -
Note that this also makes it easier to understand what the commands sequence does, so it could be useful for all shells, not just the Windows cmd shell!