bugfix: call 'InstallWinget' with admin privileges

This commit is contained in:
Baipyrus 2024-11-24 21:29:15 +01:00
parent 1e19a5e1cf
commit 9cc28a14e1

View File

@ -13,7 +13,11 @@ function WingetInstall
{ {
$install = Read-Host "Install WinGet now? [Y/n]" $install = Read-Host "Install WinGet now? [Y/n]"
if ($install.ToLower() -ne '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) winget.exe install -s winget --accept-source-agreements (Get-Content ./util/winget.list)