-
-
Notifications
You must be signed in to change notification settings - Fork 273
/
Update-AllPackage.psm1
31 lines (26 loc) · 1.04 KB
/
Update-AllPackage.psm1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Import-Module -DisableNameChecking "$PSScriptRoot\..\Title-Templates.psm1"
Import-Module -DisableNameChecking "$PSScriptRoot\..\ui\Show-MessageDialog.psm1"
$Script:DoneTitle = "Information"
$Script:DoneMessage = "Process Completed!"
function Update-AllPackage() {
Write-Section "Upgrade all Packages"
Try {
Write-Caption "Winget"
winget upgrade --all --silent | Out-Host
} Catch {
Write-Status -Types "!" -Status "Failed to upgrade packages through Winget (maybe it's uninstalled?)" -Warning
}
Try {
Write-Caption "Chocolatey"
choco upgrade all --ignore-dependencies --yes | Out-Host
} Catch {
Write-Status -Types "!" -Status "Failed to upgrade packages through Chocolatey (maybe it's uninstalled?)" -Warning
}
Try {
Write-Caption "WSL"
wsl --update | Out-Host
} Catch {
Write-Status -Types "!" -Status "Failed to upgrade packages through WSL (maybe it's uninstalled?)" -Warning
}
Show-MessageDialog -Title "$DoneTitle" -Message "$DoneMessage"
}