Skip to content

Commit f5df7be

Browse files
tpcarmanmattallford
authored andcommitted
Fix for issue #17.
If statement added to ensure tables are not generated for ESXi hosts which do not have datastores
1 parent a926b69 commit f5df7be

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Src/Public/Invoke-AsBuiltReport.VMware.vSphere.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,6 +1982,11 @@ function Invoke-AsBuiltReport.VMware.vSphere {
19821982
$VMHostHbaIScsi | Sort-Object Device | Table -Name "$VMHost iSCSI Storage Adapters" -List -ColumnWidths 25, 75
19831983
}
19841984
}
1985+
if ($Healthcheck.Datastore.CapacityUtilization) {
1986+
$VMHostDsSpecs | Where-Object {$_.'% Used' -ge 90} | Set-Style -Style Critical
1987+
$VMHostDsSpecs | Where-Object {$_.'% Used' -ge 75 -and $_.'% Used' -lt 90} | Set-Style -Style Warning
1988+
}
1989+
$VMHostDsSpecs | Sort-Object Name | Table -Name "$VMHost Datastores" #-ColumnWidths 20,10,10,10,10,10,10,10,10
19851990
}
19861991
#endregion ESXi Host Storage Adapater Information
19871992
}

0 commit comments

Comments
 (0)