Problem with external tool and command with dollar


Hi all,

I want to create tool for stop all containers in Docker.
For that I must do :

  • docker stop $(docker ps -aq)

This command works in CMD of Windows 10.
But I can't use that for my custom tool in PhpStorm.


docker stop $(docker ps -aq)
unknown shorthand flag: 'a' in -aq)
See 'docker stop --help'.

I thing '$' is the problem, thanks for your help.


Are you sure you're running it with CMD?
Because I got exactly same results there:
Maybe you're using PowerShell, not CMD?


Hi Eugene and thanks for your assistance.

You have reason, I didn't know but this command works with PowerShell only.
I tried to change default terminal in PhpStorm preferences, but it isn't worked.


I can't check that (don't wanna reboot Windows into the Hyper-V mode), but I think that powershell -Command "docker stop $(docker ps -aq)" should do the trick.


Please sign in to leave a comment.