Fix bug in pending reboot check
This commit is contained in:
		@@ -742,8 +742,8 @@ exit /b
 | 
			
		||||
function Test-PendingReboot
 | 
			
		||||
{
 | 
			
		||||
 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-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired" -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 SilentlyContinue) { return $true }
 | 
			
		||||
 try { 
 | 
			
		||||
   $util = [wmiclass]"\\.\root\ccm\clientsdk:CCM_ClientUtilities"
 | 
			
		||||
   $status = $util.DetermineIfRebootPending()
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user