Hi,
I try to generate a report where I can see the overprovisioned in percentage. but the math does not work. Can someone help me out here?
$dsrz1 = get-datastore | where-object {$_.name -match “RZ1_”} | get-view
$dsrz1rreport = @()
foreach($ds1 in $dsrz1){
$ds1 = $dsrz1 | select -expandproperty summary | select name,
@{N=”Capacity (GB)”; E={[math]::round($_.Capacity/1GB,2)}},
@{N=”FreeSpace (GB)”;E={[math]::round($_.FreeSpace/1GB,2)}},
@{N='Overprovisioned%';E={[math]::Round(100/$_.Capacity*$_.ProvisionedSpaceGB,1)}},
@{N='Freespace%';E={[math]::Round($_.Freespace/$_.Capacity*100,1)}},
@{N=”Provisioned (GB)”; E={[math]::round(($_.Capacity – $_.FreeSpace + $_.Uncommitted)/1GB,2) }}| sort -Property Name
$dsrz1rreport += $ds1
}
$dsrz1rreport