From 3844dabba3fd5ba2001b9f7aa567989402e7563f Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Thu, 13 Mar 2025 15:23:53 +0100 Subject: [PATCH] Updated list-updates.ps1 --- scripts/list-updates.ps1 | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/scripts/list-updates.ps1 b/scripts/list-updates.ps1 index 5d5c2e0b..779ec0ad 100755 --- a/scripts/list-updates.ps1 +++ b/scripts/list-updates.ps1 @@ -28,14 +28,21 @@ try { } elseif ($IsMacOS) { throw "Sorry, MacOS not supported yet" } else { - Write-Host "`n === Application 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 WinGet Store..." -foregroundColor green + & winget upgrade --include-unknown --source=winget + } + 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 } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"