Register WSL before running OneShot tasks

This commit is contained in:
Manuel Thalmann 2024-08-21 03:37:44 +02:00
parent d87636175a
commit 23d25111ea

View file

@ -167,6 +167,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)``";
@ -182,11 +189,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;
@ -483,7 +485,7 @@ $null = New-Module {
};
}
switch (Get-Stage) {
switch ($_) {
([SetupStage]::Configure) {
if (Get-Config "valhalla.windows.dualboot.enable") {
if (-not (Test-Qemu)) {
@ -607,6 +609,8 @@ $null = New-Module {
}
}
}
}
}
function Invoke-WindowsInstallation([Context] $context) {
$Global:InformationPreference = "Continue";