Added rebootifpending logic

This commit is contained in:
dfrancis-adm
2019-04-26 11:50:04 -04:00
parent e56f728099
commit ee8951ba93

View File

@@ -56,9 +56,10 @@ function Invoke-ChocoRemoteUpgrade {
}
}
#Restart machines with pending Reboot
if ($RebootifPending){
Test-PendingReboot -ComputerName $ComputerName -SkipConfigurationManagerClientCheck | Where-Object {$_.IsRebootpending -eq $True } | ForEach-Object {
Restart-Computer -ComputerName $_.ComputerName -Force
}
}
}
}