I am writing a PowerCLI script that includes taks thate take some time to complete.
For example, my script includes a command to shutdown a VM, like:
Get-VM $vm | Shutdown-VMGuest
How can I ensure that the script waits till the VM is completely powered off?
Regards
marius
The best way is to wait for the event that is fired when the VM is shut down.
See for example 1. Re: Shutdown Guest -> move-vm -> power On
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
The best way is to wait for the event that is fired when the VM is shut down.
See for example 1. Re: Shutdown Guest -> move-vm -> power On
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference