PowerShell Genie

Check pending reboot indicator

Script 2 min read Windows PowerShell 5.1 and PowerShell 7

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

1PS> Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending"

Script reader

Inspect before you run

Inspection only

Inspect the script below. It does not run in this browser.

Inspection only — no command has run.

    Show reference output
    1 True
    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"
    1. Stage 1Test-PathPositional 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.

      1. 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.

      Primary documentation

      Test-Path reference

      Continue
      Genie guideCheck pending reboot indicator

      Inspect a Windows pending reboot indicator with PowerShell. Review the specific check and its limits before using it in a wider maintenance workflow.