diff --git a/README.md b/README.md index 5284f36..89baa1c 100644 --- a/README.md +++ b/README.md @@ -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.1" + version = "0.16.3" source = "github.com/rgl/windows-update" } } diff --git a/update/windows-update.ps1 b/update/windows-update.ps1 index 3b34154..af52c1b 100644 --- a/update/windows-update.ps1 +++ b/update/windows-update.ps1 @@ -201,7 +201,8 @@ for ($i = 0; $i -lt $searchResult.Updates.Count; ++$i) { continue } - if ($update.InstallationBehavior.CanRequestUserInput) { + $updateCanRequestUserInput = try { $update.InstallationBehavior.CanRequestUserInput } catch { $false } + if ($updateCanRequestUserInput) { 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*'')" }