PowerShell/demos/Docker-PowerShell/Docker-PowerShell.ps1
Steve Lee c1c5344a88 Update copyright and license headers (#6134)
Based on standard practices, we need to have a copyright and license notice at the top of each source file. Removed existing copyrights and updated/added copyright notices for .h, .cpp, .cs, .ps1, and .psm1 files.

Updated module manifests for consistency to have Author = "PowerShell" and Company = "Microsoft Corporation". Removed multiple line breaks.

Separate PR coming to update contribution document for new source files: #6140

Manually reviewed each change.

Fix #6073
2018-02-13 09:23:53 -08:00

33 lines
1.1 KiB
PowerShell

# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# 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-Module Docker
# Pull the 'hello-world' image from Docker Hub
Pull-ContainerImage hello-world # Linux
# Pull-ContainerImage patricklang/hello-world # Windows
# Now run it
Run-ContainerImage hello-world # Linux
# Run-ContainerImage patricklang/hello-world # Windows
# Make some room on the screen
cls
# List all containers that have exited
Get-Container | Where-Object State -eq "exited"
# That found the right one, so go ahead and remove it
Get-Container | Where-Object State -eq "exited" | Remove-Container
# Now remove the container image
Remove-ContainerImage hello-world
# And list the container images left on the container host
Get-ContainerImage