Skip to content

Commit

Permalink
Limit output of Get-WUHistory to fix timeout on Windows 2012R2
Browse files Browse the repository at this point in the history
  • Loading branch information
thoscut committed Jul 3, 2020
1 parent 7e0ab91 commit 29fb1cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tasks/install_kb.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ if ($PSSenderInfo){
Start-Sleep 10
}

$update = Get-WUHistory | Where-Object KB -eq $KB | Sort-Object Date -Descending | Select-Object -First 1
$update = Get-WUHistory -Last 5 | Where-Object KB -eq $KB | Sort-Object Date -Descending | Select-Object -First 1
switch -regex ($update.Result) {
'Succeeded' {
Set-Content "$Trackingpath\$KB.flg" "Installed"
Expand Down Expand Up @@ -121,4 +121,4 @@ switch -regex ($update.Result) {
Write-Host "Could not find update $KB in the Windows Update History, it seems installation has not succeeded!"
Exit 5
}
}
}

0 comments on commit 29fb1cd

Please sign in to comment.