I have a generic script that will show me all powered off vm's on a singular host. I would like to build upon that and have it show me what date it was powered off so we know how long it's been off for. Below is the script i'm using that shows me powered off vm's on a singular host:
get-vm -location host.domain.com | ?{$_.PowerState -eq "PoweredOff"}
I can easily add multiple hosts separated by a comma and get all powered off vm's for those hosts listed out.
Also, if anyone knows of a way for me to bypass doing this one host at a time and have it check all hosts in my vcenter that would be awesome
Thanks in advance :)