Fixes and minor changes
parent
697811fed1
commit
0506eb7fa6
|
@ -299,9 +299,8 @@ if (Test-Network) {
|
||||||
if ($outdated -like "No update found.*") {
|
if ($outdated -like "No update found.*") {
|
||||||
Write-ToLog "$outdated" "cyan"
|
Write-ToLog "$outdated" "cyan"
|
||||||
}
|
}
|
||||||
|
|
||||||
#Run only if $outdated is populated!
|
#Run only if $outdated is populated!
|
||||||
if ($outdated) {
|
else {
|
||||||
#Log list of app to update
|
#Log list of app to update
|
||||||
foreach ($app in $outdated) {
|
foreach ($app in $outdated) {
|
||||||
#List available updates
|
#List available updates
|
||||||
|
|
|
@ -13,8 +13,11 @@ function Get-WingetOutdatedApps {
|
||||||
|
|
||||||
#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 "No update found. Winget upgrade output:`n$upgradeResult"
|
|
||||||
|
return "No update found. 'Winget upgrade' output:`n$upgradeResult"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
#Split winget output to lines
|
#Split winget output to lines
|
||||||
$lines = $upgradeResult.Split([Environment]::NewLine) | Where-Object { $_ }
|
$lines = $upgradeResult.Split([Environment]::NewLine) | Where-Object { $_ }
|
||||||
|
@ -73,4 +76,7 @@ function Get-WingetOutdatedApps {
|
||||||
}
|
}
|
||||||
|
|
||||||
return $upgradeList | Sort-Object { Get-Random }
|
return $upgradeList | Sort-Object { Get-Random }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue