-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwinget-upgrade.ps1
35 lines (30 loc) · 918 Bytes
/
winget-upgrade.ps1
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
32
33
34
35
#-----------------------------------------------------------------------------
#
# Copyright (c) 2022, Thierry Lelegard
# BSD-2-Clause license, see LICENSE.txt file
#
# Upgrade all installed winget packages.
# See parameters documentation in install-common.ps1.
#
#-----------------------------------------------------------------------------
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[string]$Destination = "",
[switch]$ForceDownload = $false,
[switch]$GitHubActions = $false,
[switch]$NoInstall = $false,
[switch]$NoPause = $false
)
Write-Output "==== Upgrade all installed winget packages"
. "$PSScriptRoot\install-common.ps1"
if ($NoInstall) {
Write-Output "Winget procedure, nothing to do"
}
elseif (-not $IsAdmin) {
# Execution for non-admin user, recurse for admin part.
Recurse-Admin
}
else {
winget upgrade --all --disable-interactivity
}
Exit-Script