From 8ed8d2d411f18bfe1ac732c2bce46a2c43115501 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Sun, 24 Nov 2024 22:59:51 +0100 Subject: [PATCH] allow bypassing additional installation steps --- util/winget.psm1 | 9 +++++++-- util/wsl.psm1 | 10 ++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/util/winget.psm1 b/util/winget.psm1 index 67dd42c..84a4410 100644 --- a/util/winget.psm1 +++ b/util/winget.psm1 @@ -11,8 +11,8 @@ function InstallWinget function WingetInstall { - $install = Read-Host "Install/Update WinGet now? [Y/n]" - if ($install.ToLower() -ne 'n') + $update = Read-Host "Install/Update WinGet now? [Y/n]" + if ($update.ToLower() -ne 'n') { # Start admin process, import this script, run 'InstallPackages' function Start-Process powershell.exe -Verb RunAs -Wait ` @@ -20,5 +20,10 @@ function WingetInstall "-C", "cd $pwd; ipmo ./util/winget.psm1; InstallWinget" } + $install = Read-Host "Install WinGet Packages now? [Y/n]" + if ($install.ToLower() -eq 'n') + { return + } + winget.exe install -s winget --accept-source-agreements (Get-Content ./util/winget.list) } diff --git a/util/wsl.psm1 b/util/wsl.psm1 index 493d58c..5e7e59a 100644 --- a/util/wsl.psm1 +++ b/util/wsl.psm1 @@ -17,14 +17,20 @@ function WSLInstall { return } - $install = Read-Host "Install/Update WSL2 now? [Y/n]" - if ($install.ToLower() -ne 'n') + $update = Read-Host "Install/Update WSL2 now? [Y/n]" + if ($update.ToLower() -ne 'n') { # Start admin process, import this script, run 'InstallPackages' function Start-Process powershell.exe -Verb RunAs -Wait ` -ArgumentList "-ExecutionPolicy", "Bypass", ` "-C", "cd $pwd; ipmo ./util/wsl.psm1; InstallWSL" } + + $install = Read-Host "Install WSL Distribution now? [Y/n]" + if ($install.ToLower() -eq 'n') + { return + } + wsl.exe --install -d Ubuntu # Add newly created user to sudoers group