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)