pull/683/head
Romain 2024-09-03 00:04:33 +02:00
parent 7ef9bf0c2c
commit f2ddee5a96
2 changed files with 4 additions and 5 deletions

View File

@ -295,10 +295,9 @@ if (Test-Network) {
Write-ToLog "Checking application updates on Winget Repository..." "yellow" Write-ToLog "Checking application updates on Winget Repository..." "yellow"
$outdated = Get-WingetOutdatedApps $outdated = Get-WingetOutdatedApps
#If something unusual happened #If something unusual happened or no update found
if ($outdated -like "An unusual*") { if ($outdated -like "No update found.*") {
Write-ToLog "$outdated" "cyan" Write-ToLog "$outdated" "cyan"
$outdated = $False
} }
#Run only if $outdated is populated! #Run only if $outdated is populated!

View File

@ -9,11 +9,11 @@ function Get-WingetOutdatedApps {
} }
#Get list of available upgrades on winget format #Get list of available upgrades on winget format
$upgradeResult = & $Winget upgrade --source winget | Out-String $upgradeResult = & $Winget upgrade --source winget | Where-Object { $_ -notlike " *" } | Out-String
#Start Conversion of winget format to an array. Check if "-----" exists (Winget Error Handling) #Start Conversion of winget format to an array. Check if "-----" exists (Winget Error Handling)
if (!($upgradeResult -match "-----")) { if (!($upgradeResult -match "-----")) {
return "An unusual thing happened (maybe all apps are upgraded):`n$upgradeResult" return "No update found. Winget upgrade output:`n$upgradeResult"
} }
#Split winget output to lines #Split winget output to lines