diff --git a/changelogs/fragments/42647-win_updates.yaml b/changelogs/fragments/42647-win_updates.yaml new file mode 100644 index 0000000000..6dfd252323 --- /dev/null +++ b/changelogs/fragments/42647-win_updates.yaml @@ -0,0 +1,2 @@ +bugfixes: +- win_updates - fixed module return value is lost in error in some cases (https://github.com/ansible/ansible/pull/42647) diff --git a/lib/ansible/modules/windows/win_updates.ps1 b/lib/ansible/modules/windows/win_updates.ps1 index 374b82ef8c..0962d36669 100644 --- a/lib/ansible/modules/windows/win_updates.ps1 +++ b/lib/ansible/modules/windows/win_updates.ps1 @@ -355,6 +355,8 @@ $update_script_block = { } Write-DebugLog -msg "Return value:`r`n$(ConvertTo-Json -InputObject $result -Depth 99)" + + return $result } $check_mode = $arguments.check_mode