Force the use of the managed distribution
This commit is contained in:
parent
3185e67a59
commit
e828cb1988
2 changed files with 9 additions and 1 deletions
|
@ -173,7 +173,7 @@ $null = New-Module {
|
|||
return;
|
||||
}
|
||||
|
||||
if (-not (Test-WslDistributions)) {
|
||||
if (-not (Test-WslDistribution)) {
|
||||
if (-not (Test-Path (Get-WslDistributionDisk))) {
|
||||
Install-WslDistribution;
|
||||
}
|
||||
|
|
|
@ -40,6 +40,14 @@ function Test-WslDistributions {
|
|||
& { $null = wsl -l; $?; };
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Checks whether the managed distribution is installed.
|
||||
#>
|
||||
function Test-WslDistribution {
|
||||
& { $null = wsl -d (Get-WslDistributionName) -e true; $?; };
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Installs `wsl` on the system.
|
||||
|
|
Loading…
Reference in a new issue