win_updates: Correctly report changes on success (2.7 backport) (#50225)

* win_updates: Correctly report changes on success

* Add changelog fragment
pull/50616/head
Dag Wieers 7 years ago committed by Toshio Kuratomi
parent 05322334b0
commit 39af3b0b60

@ -0,0 +1,3 @@
---
bugfixes:
- win_updates - Correctly report changes on success

@ -346,7 +346,11 @@ $update_script_block = {
$result.reboot_required = (New-Object -ComObject Microsoft.Update.SystemInfo).RebootRequired
$result.installed_update_count = $update_success_count
$result.failed_update_count = $update_fail_count
if ($updates_success_count -gt 0) {
$result.changed = $true
}
if ($update_fail_count -gt 0) {
$result.failed = $true
$result.msg = "Failed to install one or more updates"

Loading…
Cancel
Save