diff --git a/lib/ansible/modules/windows/setup.ps1 b/lib/ansible/modules/windows/setup.ps1 index 63e5597d861..1f1c4a3b07b 100644 --- a/lib/ansible/modules/windows/setup.ps1 +++ b/lib/ansible/modules/windows/setup.ps1 @@ -153,6 +153,9 @@ if ($winrm_cert_expiry) Set-Attr $result.ansible_facts "ansible_winrm_certificate_expires" $winrm_cert_expiry.NotAfter.ToString("yyyy-MM-dd HH:mm:ss") } +$PendingReboot = Get-PendingRebootStatus +Set-Attr $result.ansible_facts "ansible_reboot_pending" $PendingReboot + # See if Facter is on the System Path Try { $facter_exe = Get-Command facter -ErrorAction Stop