Skip to content

Commit 472008c

Browse files
authored
Add Windows Update alert for pending updates
1 parent eceda71 commit 472008c

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

SystemTester.ps1

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,17 @@ function Generate-Report {
830830
$criticalIssues++
831831
}
832832
}
833+
834+
# --- D.5. Windows Update Alert ---
835+
$updateTest = $script:TestResults | Where-Object {$_.Tool -eq "Windows-Update"} | Select-Object -First 1
836+
if ($updateTest -and $updateTest.Output -match "Pending:\s*(\d+)") {
837+
$pendingCount = [int]$matches[1]
838+
if ($pendingCount -gt 0) {
839+
$recommendations += "• CRITICAL: $pendingCount Windows Update(s) are pending."
840+
$recommendations += " → Install all pending updates to ensure system stability and security."
841+
$criticalIssues++
842+
}
843+
}
833844

834845
# --- E. Failed Tests Alert ---
835846
if ($failed -gt 0) {

0 commit comments

Comments
 (0)