I have attached the current script, which I am using. It works fine for VMs which are Powered On but for Powered Off VMs, I am unable to get the HDD (Capacity) as it shows blank (zero)
Need you help, if attached script can be tweaked to get the details of Powered Off VMs or a new script.
I am able to get the HDD Capacity of Powered Off VMs using
get-vm | Select Name,NumCpu,MemoryGB,UsedSpaceGB
But How do I get this added to my script, use above code only if the VMs are Powered Off else continue to current code