Only install choco if needed

This commit is contained in:
Marterich
2024-05-06 19:31:21 +02:00
parent 2354645b47
commit 7de3bbe1ff
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"