1
0
mirror of https://github.com/massgravel/Microsoft-Activation-Scripts.git synced 2024-11-22 14:46:50 +00:00

Fix bug in pending reboot check

This commit is contained in:
WindowsAddict 2024-01-01 07:26:49 +05:30
parent 0c1d091c7e
commit 1c4e85b3e2

@ -742,8 +742,8 @@ exit /b
function Test-PendingReboot function Test-PendingReboot
{ {
if (Test-Path -Path "$env:windir\WinSxS\pending.xml") { return $true } if (Test-Path -Path "$env:windir\WinSxS\pending.xml") { return $true }
if (Get-ChildItem "HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending" -EA Ignore) { return $true } if (Get-ChildItem "HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending" -EA SilentlyContinue) { return $true }
if (Get-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" -EA Ignore) { return $true } if (Get-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" -EA SilentlyContinue) { return $true }
try { try {
$util = [wmiclass]"\\.\root\ccm\clientsdk:CCM_ClientUtilities" $util = [wmiclass]"\\.\root\ccm\clientsdk:CCM_ClientUtilities"
$status = $util.DetermineIfRebootPending() $status = $util.DetermineIfRebootPending()