Check pending reboot indicator
Documentation: Microsoft Learn
Inspect a Windows pending reboot indicator with PowerShell. Review the specific check and its limits before using it in a wider maintenance workflow.
The script
Script reader
Inspect before you run
Inspect the script below. It does not run in this browser.
Inspection only — no command has run.
Show reference output
Inspect this example’s structure
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending"- Stage 1Test-Path
Positional values or no named parameters
How it works
Test-Path checks for the RebootPending key under Component Based Servicing and returns a plain boolean. That key exists only while the servicing stack has queued work waiting for the next boot, which makes its presence a reliable positive.
Adapting it
Combine this with the Windows Update flag at HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired and the PendingFileRenameOperations value under Session Manager, joining the results with -or.
If the result is unexpected
The reboot check returns False even though Windows or an installer requests a restart.
The example checks only the Component Based Servicing RebootPending key; other components use different indicators.
- Confirm the registry path and inspect the component that requested the restart rather than relying on one Boolean.
Validate the result
The result is described as the CBS indicator, with any additional reboot evidence recorded separately.
Keep the check reliable
Keep the indicator name in reports so a single registry check is not mistaken for a complete reboot assessment.