Last active
October 16, 2015 03:46
-
-
Save ScriptAutomate/1179b2db1619ce96fcd4 to your computer and use it in GitHub Desktop.
Demo code used in Twin Cities PowerShell Automation presentation
This file contains hidden or 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
# What I followed to do containers (Microsoft's Quickstart Guide): | |
# https://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/quickstart | |
break | |
# Run on Server Core 2016 TP3 | |
Start-Process PowerShell -Verb runAs | |
mkdir c:\scripts | |
wget -uri http://aka.ms/setupcontainers -OutFile c:\scripts\containersetup.ps1 | |
c:\scripts\containersetup.ps1 #This script took ~50 minutes, but downloads/installs Docker too | |
### USING POWERSHELL ### | |
# View all cmdlets/functions from Containers Module | |
Get-Command -Module Containers | |
#Take note of the IP Address you will use | |
ipconfig | |
#Take note of the WIM that you will use | |
$WIM = Get-ContainerImage | |
$VMSwitch = Get-VMSwitch | |
$Container = New-Container -Name "TCPoSH1" -ContainerImage $WIM -SwitchName "$($VMSwitch.Name)" | |
Get-Container | |
Start-Container $Container | |
# You can interact with containers via Remoting commands, as usual | |
Enter-PSSession -ContainerId $Container.ContainerId -RunAsAdministrator | |
ipconfig #Check it out | |
# DOCKER | |
docker | |
docker search windows | |
docker pull microsoft/iis | |
docker run -it --name iisdemo microsoft/iis powershell | |
docker ps -a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment