[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 $OutputEncoding = [System.Text.Encoding]::UTF8 $apps = @( "Microsoft.PowerShell", "VideoLAN.VLC", "Foxit.FoxitReader", "Python.Python.3.14", "Greenshot.Greenshot", "Google.Chrome" ) $argList = @("--accept-source-agreements", "--accept-package-agreements", "--silent") $jobs = $apps | ForEach-Object { $id = $_ Start-Job -ScriptBlock { [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 # Kill Chrome if it's running before attempting install/upgrade if ($using:id -eq "Google.Chrome") { Get-Process -Name "chrome" -ErrorAction SilentlyContinue | Stop-Process -Force Start-Sleep -Seconds 2 } $installed = winget list --id $using:id 2>$null if ($installed) { winget upgrade --id $using:id @using:argList } else { winget install --id $using:id @using:argList } } } $jobs | Wait-Job | Receive-Job $jobs | Remove-Job Write-Host "All tasks complete!" Read-Host "Press Enter to exit"