Updated install-updates.ps1 and list-updates.ps1

This commit is contained in:
Markus Fleschutz 2025-03-28 08:25:17 +01:00
parent ea112a42bd
commit af3fffb4dd
2 changed files with 13 additions and 13 deletions

View File

@ -11,7 +11,7 @@
Swap space has 1GB free (2% of 1GB used) Swap space has 1GB free (2% of 1GB used)
No pending system reboot No pending system reboot
(2/2) Installing updates from winget and Microsoft Store... (2/2) Updating Microsoft Store apps...
... ...
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
@ -55,19 +55,19 @@ try {
& "$PSScriptRoot/check-pending-reboot.ps1" & "$PSScriptRoot/check-pending-reboot.ps1"
Start-Sleep -seconds 3 Start-Sleep -seconds 3
"" ""
"⏳ (2/4) Updating Windows Store apps..." "⏳ (2/4) Updating Microsoft Store apps..."
if (Get-Command winget -ErrorAction SilentlyContinue) { if (Get-Command winget -errorAction SilentlyContinue) {
& winget upgrade --all --source=msstore --include-unknown & winget upgrade --all --source=msstore --include-unknown
} }
"" ""
"⏳ (3/4) Updating Chocolatey packages..." "⏳ (3/4) Updating WinGet Store apps..."
if (Get-Command choco -ErrorAction SilentlyContinue) { if (Get-Command winget -errorAction SilentlyContinue) {
& choco upgrade all -y & winget upgrade --all --source=winget --include-unknown
} }
"" ""
"⏳ (4/4) Updating Winget packages..." "⏳ (4/4) Updating Chocolatey packages..."
if (Get-Command winget -ErrorAction SilentlyContinue) { if (Get-Command choco -errorAction SilentlyContinue) {
& winget upgrade --all --source=winget --include-unknown & choco upgrade all -y
} }
} }
[int]$elapsed = $stopWatch.Elapsed.TotalSeconds [int]$elapsed = $stopWatch.Elapsed.TotalSeconds

View File

@ -7,7 +7,7 @@
NOTE: Execute 'install-updates.ps1' to install the listed updates. NOTE: Execute 'install-updates.ps1' to install the listed updates.
.EXAMPLE .EXAMPLE
PS> ./list-updates.ps1 PS> ./list-updates.ps1
Querying updates from Microsoft Store... Querying Microsoft Store updates...
Name Id Version Available Name Id Version Available
---------------------------------------------------------------- ----------------------------------------------------------------
@ -30,14 +30,14 @@ try {
throw "Sorry, MacOS not supported yet" throw "Sorry, MacOS not supported yet"
} else { } else {
if (Get-Command winget -ErrorAction SilentlyContinue) { if (Get-Command winget -ErrorAction SilentlyContinue) {
Write-Host "`n⏳ Querying updates from Microsoft Store..." -foregroundColor green Write-Host "`n⏳ Querying Microsoft Store updates..." -foregroundColor green
& winget upgrade --include-unknown --source=msstore & winget upgrade --include-unknown --source=msstore
Write-Host "`n⏳ Querying updates from WinGet Store..." -foregroundColor green Write-Host "`n⏳ Querying WinGet Store updates..." -foregroundColor green
& winget upgrade --include-unknown --source=winget & winget upgrade --include-unknown --source=winget
} }
if (Get-Command choco -ErrorAction SilentlyContinue) { if (Get-Command choco -ErrorAction SilentlyContinue) {
Write-Host "`n⏳ Querying updates from Chocolatey..." -foregroundColor green Write-Host "`n⏳ Querying Chocolatey updates..." -foregroundColor green
& choco outdated & choco outdated
} }
} }