This commit is contained in:
adipiciu 2022-07-20 22:17:32 +03:00 committed by GitHub
commit a96cc92b11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -216,8 +216,7 @@ function Test-PendingRebootRegistry() {
Write-Log -Message "Running Test-PendingRebootRegistry function" Write-Log -Message "Running Test-PendingRebootRegistry function"
$CBSRebootKey = Get-ChildItem "HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending" -ErrorAction Ignore $CBSRebootKey = Get-ChildItem "HKLM:\Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending" -ErrorAction Ignore
$WURebootKey = Get-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" -ErrorAction Ignore $WURebootKey = Get-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" -ErrorAction Ignore
$FileRebootKey = Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager" -Name PendingFileRenameOperations -ErrorAction Ignore if (($CBSRebootKey -ne $null) -OR ($WURebootKey -ne $null)) {
if (($CBSRebootKey -ne $null) -OR ($WURebootKey -ne $null) -OR ($FileRebootKey -ne $null)) {
Write-Log -Message "Check returned TRUE on ANY of the registry checks: Reboot is pending!" Write-Log -Message "Check returned TRUE on ANY of the registry checks: Reboot is pending!"
$true $true
} }