I have a script contining the Shutdown-VMGuest command.
I had a problem because the script was executed during the night and hung after issuing the Shutdown-VMGuest because the VMwate tools inside the VM were stopped.
The following instructions (including a check on the state of the VM) were not executed.
Is there any way to control the execution of the command, i.e. getting a result or a return code, something like:
$success = Shutdown-VMGuest
There are a couple of ways to avoid this issue.