PowerShell 技能连载 - 检测挂起的重启

下面的代码检测是否有挂起的重启:

1
2
$rebootRequired = Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending"
"Pending reboot: $rebootRequired"
评论