Skip to content

Commit

Permalink
Merge pull request #1 from philips-forks/fix_duplicate_update
Browse files Browse the repository at this point in the history
Add condition to check for duplicate queued updates
  • Loading branch information
stuartp44 authored Dec 15, 2023
2 parents 6793f63 + db8b1d3 commit 3b7b6f7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions update/windows-update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ for ($i = 0; $i -lt $searchResult.Updates.Count; ++$i) {
Write-Output "Warning The update '$updateTitle' has the CanRequestUserInput flag set (if the install hangs, you might need to exclude it with the filter 'exclude:`$_.InstallationBehavior.CanRequestUserInput' or 'exclude:`$_.Title -like '*$updateTitle*'')"
}

if (($updatesToInstall | Select-Object -ExpandProperty Title) -contains $updateTitle) {
Write-Output "Warning, Skipping queueing the duplicated titled update '$updateTitle'."
continue
}

Write-Output "Found $updateSummary"

$update.AcceptEula() | Out-Null
Expand Down

0 comments on commit 3b7b6f7

Please sign in to comment.