Would this work with install-vmhost patch?
$vmhost = get-vmhost -name (get-content esx.txt)
foreach ($esx in $vmhost)
{
set-vmhost -vmhost $esx -state maintenance
Install-VMHostPatch-VMHost$esx-HostPath/vmfs/volumes/datastore/ESXi600-201905001/metadata.zip
}
would the host automatically reboot after the install-vmhostpatch and set itself back into connected state or will it stay in maintenance mode?
Do I need a wait loop?