PowerCLI to find vCPU to pCPU ratio and vRAM to pRAM ratio

vsphere-PowerCLI
 
 
I was in search for a script to generate report on vCPU to pCPU ratio and vRAM to pRAM at cluster level in a vCenter. Found couple of interesting community threads which address part of the requirements. Thought to consolidate (or extract:) ) the code and created the following. The report will be generated as CSV file.

Output in table format :

DatacenterClusterNamevCPU-pCPUCoreRatiovRAM-pRAMRatioNumVMHostsNumPCPUSocketsNumPCPUCoresNumvCPUPhysicalMem(GB)VirtualMem(GB)
1234512345-HypClus11.85:10.28:1364889768214
678910678910-HypClus20.60:10.21:152016096640132
1234512345-HypClus22.08:10.91:12212256458

Ref : https://communities.vmware.com/thread/456555?start=0&tstart=0