View difference between Paste ID: LiuFHJfc and NFBCfZ4c
SHOW: | | - or go back to the newest paste.
1
# Check for Windows 10 version 1607
2
if ([int](Get-WmiObject -Class Win32_OperatingSystem).BuildNumber -lt 14393) {
3
    Write-Warning -Message "Unsupported build of Windows 10 detected, exiting" ; exit 1
4
}
5
# Enable Dev Mode
6
$RegistryKeyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
7
if (-not(Test-Path -Path $RegistryKeyPath)) {
8
    New-Item -Path $RegistryKeyPath -ItemType Directory -Force
9
}
10
New-ItemProperty -Path $RegistryKeyPath -Name AllowDevelopmentWithoutDevLicense -PropertyType DWORD -Value 1
11
12
# Enable Bash
13
Enable-WindowsOptionalFeature -FeatureName Microsoft-Windows-Subsystem-Linux -Online -All -LimitAccess -NoRestart -ErrorAction Stop