diff --git a/scripts/Windows/OS/Install.ps1 b/scripts/Windows/OS/Install.ps1 index 5c3b527f..726a4b7c 100644 --- a/scripts/Windows/OS/Install.ps1 +++ b/scripts/Windows/OS/Install.ps1 @@ -67,16 +67,29 @@ $null = New-Module { continue; } + if (-not (Test-Winget)) { + . "$PSScriptRoot/../Software/winget/Manage.ps1"; + continue; + } + + if (-not (& { wsl --status; $?; })) { + wsl --install --no-launch; + Restart-Intermediate; + return; + } + + if (-not (wsl --shell-type login type -t nix)) { + ubuntu install --root; + wsl -- sh `<`(curl -L https://nixos.org/nix/install`) --daemon --yes; + wsl --shutdown; + continue; + } + Invoke-Hook "Install-PSModules" -Fallback { Install-Module -AcceptLicense -Force PSWindowsUpdate; Install-Module -AcceptLicense -Force PSScriptAnalyzer; . "$PSScriptRoot/../../Common/Software/PinnedItem/Manage.ps1"; }; - - if (-not (Test-Winget)) { - . "$PSScriptRoot/../Software/winget/Manage.ps1"; - continue; - } if (-not (Test-PSPackage Selenium.WebDriver)) { Install-Module -AcceptLicense -Force NuGet; @@ -86,20 +99,7 @@ $null = New-Module { } Install-ChocoPackage selenium-gecko-driver firefox; - - if (-not (& { wsl --status; $?; })) { - wsl --install --no-launch; - Restart-Intermediate; - return; - } else { - ubuntu install --root; - wsl -- sh `<`(curl -L https://nixos.org/nix/install`) --daemon --yes; - wsl --shutdown; - } - - if (wsl --shell-type login type -t nix) { - Set-Stage ([SetupStage]::Configure); - } + Set-Stage ([SetupStage]::Configure); } else { $null = Import-Module PSWindowsUpdate;