Link to home
Create AccountLog in
Avatar of LockDown32
LockDown32Flag for United States of America

asked on

Need to determine if a computer needs to be restarted

After a Windows Update it indicates if a restart is needed or not. Can I somehow get that in a PowerShell script? If it needs to be rebooted?
ASKER CERTIFIED SOLUTION
Avatar of Hello There
Hello There

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
I think you need to check HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServicesOnce in the registry

I am using a patch deployment system (HCL BigFix) and this is the key they check to see if a computer needs a reboot
Avatar of LockDown32

ASKER

I am new to PowerShell. So what would the syntax be on the above?

if Test-PendingReboot = $True
  {
   Reboot or something
  }