mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-12 19:44:41 +02:00
Update install-updates.ps1 and list-updates.ps1
This commit is contained in:
parent
5a992a9254
commit
7380410e28
@ -3,6 +3,7 @@
|
|||||||
Installs software updates
|
Installs software updates
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This PowerShell script installs updates for the local machine (needs admin rights).
|
This PowerShell script installs updates for the local machine (needs admin rights).
|
||||||
|
Use "list-updates.ps1" to list available updates.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./install-updates
|
PS> ./install-updates
|
||||||
.LINK
|
.LINK
|
||||||
|
@ -14,16 +14,15 @@
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if ($IsLinux) {
|
if ($IsLinux) {
|
||||||
Write-Host "⏳ Querying package updates..."
|
"⏳ (1/2) Querying package updates... (use install-updates.ps1 to install them)"
|
||||||
& sudo apt update
|
& sudo apt update
|
||||||
& sudo apt list --upgradable
|
& sudo apt list --upgradable
|
||||||
Write-Host "⏳ Querying Snap updates..."
|
"⏳ (2/2) Querying Snap updates... (use install-updates.ps1 to install them)"
|
||||||
sudo snap refresh --list
|
sudo snap refresh --list
|
||||||
} else {
|
} else {
|
||||||
Write-Progress "⏳ Querying application updates..."
|
"⏳ Querying application updates... (use install-updates.ps1 to install them)"
|
||||||
" "
|
" "
|
||||||
& winget upgrade
|
& winget upgrade
|
||||||
Write-Progress -Completed " "
|
|
||||||
}
|
}
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
|
Loading…
Reference in New Issue
Block a user