-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add operating system and edition checks to WSL, Docker, Hyper-V, and …
…developer mode enable scripts
- Loading branch information
Showing
5 changed files
with
64 additions
and
36 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
Enable-WindowsOptionalFeature -Online -FeatureName containers -All | ||
RefreshEnv | ||
choco install -y docker-for-windows | ||
choco install -y vscode-docker | ||
if( | ||
# 64-bit edition of Windows | ||
[Environment]::Is64BitOperatingSystem -and | ||
# Editions with Hyper-V | ||
# (See also: https://docs.microsoft.com/en-gb/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getproductinfo) | ||
((Get-WmiObject Win32_OperatingSystem).OperatingSystemSKU -in 0x06, 0x10, 0x12, 0x50, 0x8, 0xC, 0x79, 0x7A, 0x04, 0x46, 0x48, 0x1B, 0x54, 0x7D, 0x81, 0x7E, 0x82, 0x0A, 0x0E, 0x2A, 0xA1, 0xA2, 0x30, 0x45, 0x31, 0x67, 0x18, 0x4F, 0x07, 0x0D, 0x01, 0x47, 0x1C) -and | ||
# Windows 10 Anniversary Update or later | ||
((Get-WmiObject Win32_OperatingSystem).BuildNumber -ge 14393)) { | ||
Enable-WindowsOptionalFeature -Online -FeatureName containers -All | ||
RefreshEnv | ||
choco install -y docker-for-windows | ||
choco install -y vscode-docker | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,15 @@ | ||
choco install -y Microsoft-Hyper-V-All --source="'windowsFeatures'" | ||
# Install Hyper-V | ||
if( | ||
# 64-bit edition of Windows | ||
[Environment]::Is64BitOperatingSystem -and | ||
# Editions with Hyper-V | ||
# (See also: https://docs.microsoft.com/en-gb/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getproductinfo) | ||
((Get-WmiObject Win32_OperatingSystem).OperatingSystemSKU -in 0x06, 0x10, 0x12, 0x50, 0x8, 0xC, 0x79, 0x7A, 0x04, 0x46, 0x48, 0x1B, 0x54, 0x7D, 0x81, 0x7E, 0x82, 0x0A, 0x0E, 0x2A, 0xA1, 0xA2, 0x30, 0x45, 0x31, 0x67, 0x18, 0x4F, 0x07, 0x0D, 0x01, 0x47, 0x1C) -and | ||
( | ||
# Server 2008 or later | ||
([Environment]::OSVersion.Version -ge (New-Object 'Version' 6,0) -and (Get-WmiObject Win32_OperatingSystem).ProductType -gt 1) -or | ||
# Windows 8 or later on client operating systems | ||
([Environment]::OSVersion.Version -ge (New-Object 'Version' 6,2)) | ||
)) { | ||
choco install -y Microsoft-Hyper-V-All --source="'windowsFeatures'" | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
|
||
|
||
#--- Enable developer mode on the system --- | ||
Set-ItemProperty -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\AppModelUnlock -Name AllowDevelopmentWithoutDevLicense -Value 1 | ||
# (if on Windows 8 / Server 2012 or later) | ||
if([Environment]::OSVersion.Version -ge (New-Object 'Version' 6,2)) { | ||
Set-ItemProperty -Path HKLM:\Software\Microsoft\Windows\CurrentVersion\AppModelUnlock -Name AllowDevelopmentWithoutDevLicense -Value 1 | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,31 @@ | ||
choco install -y Microsoft-Windows-Subsystem-Linux --source="'windowsfeatures'" | ||
if ((Get-WmiObject Win32_OperatingSystem).BuildNumber -ge 14316) { | ||
choco install -y Microsoft-Windows-Subsystem-Linux --source="'windowsfeatures'" | ||
|
||
#--- Ubuntu --- | ||
# TODO: Move this to choco install once --root is included in that package | ||
Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1804 -OutFile ~/Ubuntu.appx -UseBasicParsing | ||
Add-AppxPackage -Path ~/Ubuntu.appx | ||
# run the distro once and have it install locally with root user, unset password | ||
#--- Ubuntu --- | ||
# TODO: Move this to choco install once --root is included in that package | ||
Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1804 -OutFile ~/Ubuntu.appx -UseBasicParsing | ||
Add-AppxPackage -Path ~/Ubuntu.appx | ||
# run the distro once and have it install locally with root user, unset password | ||
|
||
RefreshEnv | ||
Ubuntu1804 install --root | ||
Ubuntu1804 run apt update | ||
Ubuntu1804 run apt upgrade -y | ||
RefreshEnv | ||
Ubuntu1804 install --root | ||
Ubuntu1804 run apt update | ||
Ubuntu1804 run apt upgrade -y | ||
|
||
<# | ||
NOTE: Other distros can be scripted the same way for example: | ||
<# | ||
NOTE: Other distros can be scripted the same way for example: | ||
#--- SLES --- | ||
# Install SLES Store app | ||
Invoke-WebRequest -Uri https://aka.ms/wsl-sles-12 -OutFile ~/SLES.appx -UseBasicParsing | ||
Add-AppxPackage -Path ~/SLES.appx | ||
# Launch SLES | ||
sles-12.exe | ||
# --- openSUSE --- | ||
Invoke-WebRequest -Uri https://aka.ms/wsl-opensuse-42 -OutFile ~/openSUSE.appx -UseBasicParsing | ||
Add-AppxPackage -Path ~/openSUSE.appx | ||
# Launch openSUSE | ||
opensuse-42.exe | ||
#> | ||
#--- SLES --- | ||
# Install SLES Store app | ||
Invoke-WebRequest -Uri https://aka.ms/wsl-sles-12 -OutFile ~/SLES.appx -UseBasicParsing | ||
Add-AppxPackage -Path ~/SLES.appx | ||
# Launch SLES | ||
sles-12.exe | ||
# --- openSUSE --- | ||
Invoke-WebRequest -Uri https://aka.ms/wsl-opensuse-42 -OutFile ~/openSUSE.appx -UseBasicParsing | ||
Add-AppxPackage -Path ~/openSUSE.appx | ||
# Launch openSUSE | ||
opensuse-42.exe | ||
#> | ||
} |