Created
October 11, 2016 08:20
-
-
Save edib/a849600bf6b664a01c91e21aec834ecf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
&{ ForEach ($esx in Get-VMHost) { | |
$vCPU = Get-VM -Location $esx | Measure-Object -Property NumCpu -Sum | select -ExpandProperty Sum | |
$esx | Select Name, | |
@{N='pCPU cores available';E={$_.NumCpu}}, | |
@{N='vCPU assigned to VMs';E={$vCPU}}, | |
@{N='Ratio';E={[math]::Round($vCPU/$_.NumCpu,1)}}, | |
@{N='CPU Overcommit (%)';E={[Math]::Round(100*(($vCPU - $_.NumCpu) / $_.NumCpu), 1)}} | |
} } | Export-Csv report.csv -NoTypeInformation -UseCulture |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment