Skip to content

Commit

Permalink
ignore updates without a title
Browse files Browse the repository at this point in the history
  • Loading branch information
rgl committed Jul 11, 2024
1 parent ddef94e commit 154314f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Configure your packer template to require a [release version of the plugin](http
packer {
required_plugins {
windows-update = {
version = "0.16.3"
version = "0.16.4"
source = "github.com/rgl/windows-update"
}
}
Expand Down
7 changes: 6 additions & 1 deletion update/windows-update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,15 @@ for ($i = 0; $i -lt $searchResult.Updates.Count; ++$i) {
if (!$update) {
continue
}

$updateTitle = $update.Title
if (!$updateTitle) {
continue
}

$updateMaxDownloadSize = try { [int64]$update.MaxDownloadSize } catch { [int64]0 }
$updateDate = try { $update.LastDeploymentChangeTime.ToString('yyyy-MM-dd') } catch { '1970-01-01' }
$updateSize = ($updateMaxDownloadSize/1024/1024).ToString('0.##')
$updateTitle = $update.Title
$updateSummary = "Windows update ($updateDate; $updateSize MB): $updateTitle"

if (!(Test-IncludeUpdate $updateFilters $update)) {
Expand Down

0 comments on commit 154314f

Please sign in to comment.