* Add WSL

* Move WSL to the end of the provision

* Add elevated_user

* No restart VM

* Add Validation

* Add WSL note in Readme.md

* Rename WSL1 to WSL

Co-authored-by: Sergey Dolin <v-sedoli@micorosoft.com>
This commit is contained in:
Sergey Dolin
2020-07-09 11:57:02 +05:00
committed by GitHub
parent 1c22abb30d
commit c6950533af
4 changed files with 42 additions and 1 deletions

View File

@@ -109,6 +109,14 @@
],
"execution_policy": "unrestricted"
},
{
"type": "powershell",
"elevated_user": "SYSTEM",
"elevated_password": "",
"scripts":[
"{{ template_dir }}/scripts/Installers/Windows2019/Install-WSL.ps1"
]
},
{
"type": "powershell",
"scripts":[
@@ -243,6 +251,12 @@
"{{ template_dir }}/scripts/Installers/Validate-Wix.ps1"
]
},
{
"type": "powershell",
"scripts":[
"{{ template_dir }}/scripts/Installers/Validate-WSL.ps1"
]
},
{
"type": "powershell",
"scripts":[
@@ -1062,4 +1076,4 @@
]
}
]
}
}

View File

@@ -0,0 +1,14 @@
################################################################################
## File: Validate-WSL.ps1
## Desc: Validate WSL CLI existst
################################################################################
if (Get-Command -Name 'wsl')
{
Write-Host 'wsl is on path'
}
else
{
Write-Host 'wsl not on path'
exit 1
}

View File

@@ -0,0 +1,8 @@
################################################################################
## File: Install-WSL.ps1
## Desc: Install Windows Subsystem for Linux
################################################################################
Write-Host "Install Windows Subsystem for Linux"
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux -NoRestart

View File

@@ -22,6 +22,11 @@ $markdown += New-MDList -Style Unordered -Lines @(
"Image Version: $env:ImageVersion"
)
$markdown += New-MDHeader "Enabled windows optional features" -Level 2
$markdown += New-MDList -Style Unordered -Lines @(
"Windows Subsystem for Linux"
)
$markdown += New-MDHeader "Installed Software" -Level 2
$markdown += New-MDHeader "Language and Runtime" -Level 3