Updated list-updates.ps1

This commit is contained in:
Markus Fleschutz 2025-03-13 15:23:53 +01:00
parent 372ab71fc2
commit 3844dabba3

View File

@ -28,14 +28,21 @@ try {
} elseif ($IsMacOS) { } elseif ($IsMacOS) {
throw "Sorry, MacOS not supported yet" throw "Sorry, MacOS not supported yet"
} else { } else {
Write-Host "`n === Application Updates from WinGet Store ===" -foregroundColor green if (Get-Command winget -ErrorAction SilentlyContinue) {
& winget upgrade --include-unknown --source=winget Write-Host "`n⏳ Querying updates from WinGet Store..." -foregroundColor green
& winget upgrade --include-unknown --source=winget
Write-Host "`n === Application Updates from Microsoft Store ===" -foregroundColor green }
& winget upgrade --include-unknown --source=msstore if (Get-Command winget -ErrorAction SilentlyContinue) {
Write-Host "`n⏳ Querying updates from Microsoft Store..." -foregroundColor green
& winget upgrade --include-unknown --source=msstore
}
if (Get-Command choco -ErrorAction SilentlyContinue) {
Write-Host "`n⏳ Querying updates from Chocolatey..." -foregroundColor green
& choco outdated
}
} }
" " " "
"NOTE: Execute script 'install-updates.ps1' to install the listed updates." "💡 Execute the script 'install-updates.ps1' to install the listed updates."
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"