-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Expand file tree
/
Copy pathInvoke-WPFInstallUpgrade.ps1
More file actions
19 lines (15 loc) · 916 Bytes
/
Copy pathInvoke-WPFInstallUpgrade.ps1
File metadata and controls
19 lines (15 loc) · 916 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
function Invoke-WPFInstallUpgrade {
if ($sync.ChocoRadioButton.IsChecked) {
Install-WinUtilChoco # Ensure Chocolatey is installed before upgrading
Write-Host "==========================================="
Write-Host "-- Updates started ---"
Write-Host "==========================================="
Start-Process -FilePath choco.exe -ArgumentList 'upgrade all -y' -Wait -NoNewWindow
} else {
Install-WinUtilWinget # Ensure WinGet is installed before upgrading
Write-Host "==========================================="
Write-Host "-- Updates started ---"
Write-Host "==========================================="
Start-Process -FilePath winget.exe -ArgumentList 'upgrade --all --include-unknown --silent --accept-source-agreements --accept-package-agreements' -Wait -NoNewWindow
}
}