Hi All,
I'm attempting to write a script that will gather information about the VMs in a vCenter environment, namely Name, vCPUs, Memory, Operating System, and, the kicker, disk information (specifically, capacity and free space). The script is attached, with many parts borrowed.
Now, typically, I would use the New-Object -TypeName PSObject -Property @{ }, but I couldn't find any way to use any sort of logic (i.e. a ForEach loop within this), and this is required. For some reason, the columns for vCPU, MemoryGB, and GuestOS are blank. Also, it's transposing the two disks, swapping the C:\ and E:\ drives (attached as well). The Name works, but has been blanked out to protect the innocent.
Thank you, in advance, for any help!