Enhance app removal verification and error reporting (#735)

This commit is contained in:
Jeffrey
2026-08-12 15:56:29 +02:00
committed by GitHub
parent 9505a5a374
commit d1338cd027
16 changed files with 328 additions and 179 deletions
@@ -66,7 +66,14 @@ function Get-WingetInstalledApps {
}
}
if ($dataStart -lt 0 -or $dataStart -ge $lines.Count) { return @() }
# A missing table separator means the output is malformed or empty
if ($dataStart -lt 0) {
return $null
}
if ($dataStart -ge $lines.Count) {
return ,@()
}
$apps = [System.Collections.Generic.List[object]]::new()
@@ -94,7 +101,7 @@ function Get-WingetInstalledApps {
}
}
return @($apps)
return ,@($apps)
}
Remove-Job -Job $job -Force -ErrorAction SilentlyContinue