Hi everyone,
I made a script which restarts a couple of servers which have dependent services. So I'm checking if every server is properly shutdown with these lines:
while((Get-VM -Name $myServer).PowerState -ne "PoweredOff"){
Start-Sleep -Seconds 5
}
This generally works, but it takes like 5 minutes more for the script to recognize that a machine is powered off, compared to what's shown in vSphere Client.
Is this a known problem or am I doing something wrong?