WC:UsersshbindalDocumentsawsDevopsEx_Files_Learning_DockerNew folder>docker ps -aq | xargs docker stop | xargs docker rm
'xargs' is not recognized as an internal or external command,
operable program or batch file.
C:UsersshbindalDocumentsawsDevopsEx_Files_Learning_DockerNew folder>docker ps -q | % { docker rm $_ }
'%' is not recognized as an internal or external command,
operable program or batch file.
C:UsersshbindalDocumentsawsDevopsEx_Files_Learning_DockerNew folder>docker rm $(docker ps -aq)
unknown shorthand flag: 'a' in -aq)
See 'docker rm --help'.
C:UsersshbindalDocumentsawsDevopsEx_Files_Learning_DockerNew folder>
Was not able to remove all containers at once
1
You can do this with powershell assuming your Docker installation is in Windows.
docker ps -aq | ForEach-Object { docker stop $_ }
docker ps -aq | ForEach-Object { docker rm $_ }
To do both in one step:
docker ps -aq | ForEach-Object { docker stop $_; docker rm $_ }