Skip to content

Instantly share code, notes, and snippets.

@thomas11
Created November 20, 2017 03:56
Show Gist options
  • Save thomas11/e2ec2b043c05f103b72f4b80b22794ed to your computer and use it in GitHub Desktop.
Save thomas11/e2ec2b043c05f103b72f4b80b22794ed to your computer and use it in GitHub Desktop.
Stop all running Docker containers in Powershell
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