How To: Use PowerShell to Check Pending Reboot
Overview
This document will cover using PowerShell to check for any pending reboots.
Prerequisites
Administrator access to Windows PowerShell
Instructions
Open PowerShell as Administrator
Run the following command
$pendingReboot = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" -ErrorAction SilentlyContinue
if ($pendingReboot -ne $null) {
Write-Host "Pending reboot detected."
} else {
Write-Host "No pending reboot found."
}Here is a sample of the output that is returned when no reboot is needed:
Need Support?
If you need assistance, our support team is here to help. You can create, view, and manage support tickets through our portal at any time.
Support Portal: https://connectsecure.freshdesk.com
Email: support@connectsecure.com
please update the email address