Advertisement
Guest User

Enable Linux Subsystem In Windows 10

a guest
Jun 4th, 2017
3,639
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement