From 9cc28a14e13fd38abc63f8e5fd354edfc8182fbe Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Sun, 24 Nov 2024 21:29:15 +0100 Subject: [PATCH] bugfix: call 'InstallWinget' with admin privileges --- util/winget.psm1 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util/winget.psm1 b/util/winget.psm1 index a612b54..ff3e94d 100644 --- a/util/winget.psm1 +++ b/util/winget.psm1 @@ -13,7 +13,11 @@ function WingetInstall { $install = Read-Host "Install WinGet now? [Y/n]" if ($install.ToLower() -ne 'n') - { InstallWinget + { + # Start admin process, import this script, run 'InstallPackages' function + Start-Process powershell.exe -Verb RunAs ` + -ArgumentList "-C", "'Import-Module ./winget.psm1; InstallWinget'" + } winget.exe install -s winget --accept-source-agreements (Get-Content ./util/winget.list)