Getting Virtual Machine CPU, Disk and Memory

I was asked to pull disk, memory and cpu statistics from VMware guests managed by multiple Virtual Center servers. Working with the VMWare Senior Administrator, we came up with this.$CsvFile = "C:\VM_Hosts_Info.csv"$CsvData = @()$VCSrvs = "VCenter01","VCenter02","VCenter03"ForEach ($VCSrv in $VCSrvs){Connect-VIServer -server $VCSrvGet-VM | % {$VM = $_$Disk_T = "{0:N1}" -f(($VM | Get-HardDisk | measure-object -property CapacityKB …