# This is a short example of the Docker-PowerShell module. The same cmdlets may be used to manage both local & remote machines, including both Windows & Linux hosts
# The only difference between them is the example container image is pulled & run.
# Import the Docker module
# It's available at https://github.com/Microsoft/Docker-PowerShell
Import-ModuleDocker
# Pull the 'hello-world' image from Docker Hub
Pull-ContainerImagehello-world# Linux
# Pull-ContainerImage patricklang/hello-world # Windows
# Now run it
Run-ContainerImagehello-world# Linux
# Run-ContainerImage patricklang/hello-world # Windows
# Make some room on the screen
cls
# List all containers that have exited
Get-Container|Where-ObjectState-eq"exited"
# That found the right one, so go ahead and remove it