Only install choco if needed (#1943)

This commit is contained in:
Martin Wiethan
2024-05-10 06:13:57 +02:00
committed by GitHub
parent 1c80af1aca
commit cc02facb11
4 changed files with 8 additions and 3 deletions

View File

@ -53,6 +53,8 @@ function Install-WinUtilWinget {
Write-Host "Failure detected while installing via GitHub method. Continuing with Chocolatey method as fallback." -ForegroundColor Red
# In case install fails via GitHub method.
Try {
# Install Choco if not already present
Install-WinUtilChoco
Start-Process -Verb runas -FilePath powershell.exe -ArgumentList "choco install winget-cli"
Write-Host "Winget Installed" -ForegroundColor Green
Write-Output "Refreshing Environment Variables...`n"