Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
$ErrorActionPreference = "Stop"
if ((Get-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V -Online).State -ne 'Enabled') {
Enable-WindowsOptionalFeature -FeatureName Microsoft-Hyper-V -Online -All -NoRestart
if ((Get-WindowsOptionalFeature -FeatureName Containers -Online).State -ne 'Enabled') {
Enable-WindowsOptionalFeature -FeatureName Containers -Online -All -NoRestart
if (!(Test-Path dockerd.exe)) {
Start-BitsTransfer -Destination dockerd.exe -Source
if (!(Test-Path docker.exe)) {
Start-BitsTransfer -Destination docker.exe -Source
if (!(Test-Path {
[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls"
$wc = New-Object System.Net.WebClient
$wc.DownloadFile('', "$PSScriptRoot\")
Remove-Item "$env:ProgramFiles\Linux Containers" -Force -Recurse
Expand-Archive -DestinationPath "$Env:ProgramFiles\Linux Containers\."
.\dockerd.exe -D --experimental
docker run --platform linux --rm -ti busybox sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.