-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathGetHostPathStatus.ps1
More file actions
27 lines (27 loc) · 899 Bytes
/
Copy pathGetHostPathStatus.ps1
File metadata and controls
27 lines (27 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Get-VMHost | Sort-Object -property Name | ForEach-Object {
$VMHost = $_
$VMHost | Get-VMHostHba | Sort-Object -property Device | ForEach-Object {
$VMHostHba = $_
$ScsiLun = $VMHostHba | Get-ScsiLun
If ($ScsiLun) {
$ScsiLunPath = $ScsiLun | Get-ScsiLunPath | `
Where-Object {$_.Name -like "$($VMHostHba.Device)*"}
$Targets = ($ScsiLunPath | `
Group-Object -Property SanID | Measure-Object).Count
$Devices = ($ScsiLun | Measure-Object).Count
$Paths = ($ScsiLunPath | Measure-Object).Count
}
Else {
$Targets = 0
$Devices = 0
$Paths = 0
}
$Report = "" | Select-Object -Property VMHost,HBA,Targets,Devices,Paths
$Report.VMHost = $VMHost.Name
$Report.HBA = $VMHostHba.Device
$Report.Targets = $Targets
$Report.Devices = $Devices
$Report.Paths = $Paths
$Report
}
}