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
Would a ping be sufficient.
In PowerShell v3 you have the very handy Test-Connection cmdlet for that.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Would a ping be sufficient.
In PowerShell v3 you have the very handy Test-Connection cmdlet for that.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You know, I think that would work. Thanks for the suggestion.