I made the following script to update all our hosts. It saves me a lot of time when updating all my hosts because now I can start the script and have just to wait untill all my hosts are updated. Before I had to put a host in maintenance mode, remediate the host and exit maintenance mode. And I had to do this for all my hosts. The script asumes that you use DRS in your clusters to move the VM's when you put a host in maintenance mode:
$Baseline = Get-Baseline -TargetType host
Get-VMhost | ForEach-Object {
Set-VMhost -vmhost $_ -state maintenance
Remediate-Inventory -Entity $_ -Baseline $Baseline -Confirm:$False
Set-VMhost -vmhost $_ -state connected
}
Have fun!
Robert van den Nieuwendijk