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