Hi guys,
I made a script by copying a little bit of here is a little bit of there to turn off all my vMware infrastructure.
The script works fine, I only have some problems and we who would like to understand with you and maybe find a solution, I go in order:
1) when it sends the command "Get-VM -Name" SRV01 "| shutdown-vmguest -Confirm: $ false" it takes more seconds than usual to shut down because it has more substantial services (database). So I would like to understand how to give it a maximum time, like if it takes more than 10 seconds run STOP-VM.
2) I would like to have a log to see what happens and what went wrong. I am using Start-Transcript, but I don't find it efficient
3) In case of errors I would like the script to stop and not continue to send further commands.
I hope I was as clear as possible
Thank you
Moderator note by wila: Moved thread to VMware PowerCLI discussions