Created
November 20, 2017 03:56
-
-
Save thomas11/e2ec2b043c05f103b72f4b80b22794ed to your computer and use it in GitHub Desktop.
Stop all running Docker containers in Powershell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Stop-AllDockerContainers() { | |
$containers = docker container ls | Select-Object -Skip 1 | |
if ($containers) { | |
$containers | Foreach-Object { $_.Split(' ')[0] } | Foreach-Object { docker container stop $_ } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment