Register WSL before running OneShot tasks
This commit is contained in:
parent
fdeb84f42b
commit
31e3c51f97
|
@ -170,6 +170,13 @@ $null = New-Module {
|
|||
Set-Stage ([SetupStage]::Configure);
|
||||
break;
|
||||
}
|
||||
default {
|
||||
if (-not (& { $null = wsl -l; $? })) {
|
||||
wsl --import-in-place "PortValhalla" "$wslLocation/ext4.vhdx";
|
||||
wsl --set-default "PortValhalla";
|
||||
}
|
||||
|
||||
switch ($_) {
|
||||
([SetupStage]::OneShot) {
|
||||
Write-Host "Running OneShot task ``$(Get-OneShotTask)``";
|
||||
|
||||
|
@ -185,11 +192,6 @@ $null = New-Module {
|
|||
break;
|
||||
}
|
||||
default {
|
||||
if (-not (& { $null = wsl -l; $? })) {
|
||||
wsl --import-in-place "PortValhalla" "$wslLocation/ext4.vhdx";
|
||||
wsl --set-default "PortValhalla";
|
||||
}
|
||||
|
||||
if (Test-Admin) {
|
||||
$null = Import-Module PSWindowsUpdate;
|
||||
|
||||
|
@ -486,7 +488,7 @@ $null = New-Module {
|
|||
};
|
||||
}
|
||||
|
||||
switch (Get-Stage) {
|
||||
switch ($_) {
|
||||
([SetupStage]::Configure) {
|
||||
if (Get-Config "valhalla.windows.dualboot.enable") {
|
||||
if (-not (Test-Qemu)) {
|
||||
|
@ -610,6 +612,8 @@ $null = New-Module {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Invoke-WindowsInstallation([Context] $context) {
|
||||
$Global:InformationPreference = "Continue";
|
||||
|
|
Loading…
Reference in a new issue