Hello friends,
I am writing some scripts and I (dumb) relied on the value "poweredstate" to determine if a VM is ready for some maintenance. I now found out that if a VM is poweredOn and I begin a Power>Shutdown Guest, the state immediately changes to PoweredOff even as the VM operating system is still shutting down. This is causing me issues since I want the VM totally powered off.
Example: $powerstate = ((get-vm | where {$_.name -like $variable}).powerstate)
Please direct me to a more reliable way to determine if the VM is powered down 'all the way'.
Thanks,
Scott