Added rebootifpending logic
This commit is contained in:
@@ -56,9 +56,10 @@ function Invoke-ChocoRemoteUpgrade {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#Restart machines with pending Reboot
|
#Restart machines with pending Reboot
|
||||||
|
if ($RebootifPending){
|
||||||
Test-PendingReboot -ComputerName $ComputerName -SkipConfigurationManagerClientCheck | Where-Object {$_.IsRebootpending -eq $True } | ForEach-Object {
|
Test-PendingReboot -ComputerName $ComputerName -SkipConfigurationManagerClientCheck | Where-Object {$_.IsRebootpending -eq $True } | ForEach-Object {
|
||||||
Restart-Computer -ComputerName $_.ComputerName -Force
|
Restart-Computer -ComputerName $_.ComputerName -Force
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user