I see that my script got a little mangled by the forum software. I was quite new to the forum when I posted the script. Will do it better this time ;-).
$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
}