From 5014da3a46276c1b85a077b51fc0c9d39075c093 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Sun, 24 Nov 2024 21:40:51 +0100 Subject: [PATCH] bugfix: install wsl and windows features as administrator --- util/wsl.psm1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/util/wsl.psm1 b/util/wsl.psm1 index 5fa0cc2..ede8554 100644 --- a/util/wsl.psm1 +++ b/util/wsl.psm1 @@ -19,7 +19,10 @@ function WSLInstall $install = Read-Host "Install WSL2 now? [Y/n]" if ($install.ToLower() -ne 'n') - { InstallWSL + { + # Start admin process, import this script, run 'InstallPackages' function + Start-Process powershell.exe -Verb RunAs -Wait ` + -ArgumentList "-C", "'Import-Module ./wsl.psm1; InstallWSL'" } wsl.exe --install -d Ubuntu