From 646fc149bb941f69cb8b990c051b78a3059afc19 Mon Sep 17 00:00:00 2001 From: zm1990s Date: Fri, 18 Oct 2019 13:18:08 +0800 Subject: [PATCH] Update io-devices-report.ps1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix for “unable to get lsi_mr3 driver version” --- powershell/io-devices-report.ps1 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/powershell/io-devices-report.ps1 b/powershell/io-devices-report.ps1 index 2df38b6..86e180e 100644 --- a/powershell/io-devices-report.ps1 +++ b/powershell/io-devices-report.ps1 @@ -74,12 +74,15 @@ Foreach ($device in $devices) { $vmhbaId = $device.VMHost |Get-VMHostHba -ErrorAction SilentlyContinue | where { $_.PCI -like '*'+$device.Id} $Info.Device = $vmhbaId.Device $Info.Driver = $vmhbaId.Driver - + # fix lsi_mr3 to lsi-mr3 + $vibnamefixed = $vmhbaId.Driver + $vibnamefixed = $vibnamefixed -replace"_","-" + # Get driver vib package version Try{ - $driverVib = $esxcli.software.vib.get.Invoke(@{vibname = "scsi-"+$vmhbaId.Driver}) + $driverVib = $esxcli.software.vib.get.Invoke(@{vibname = "scsi-"+$vibnamefixed}) }Catch{ - $driverVib = $esxcli.software.vib.get.Invoke(@{vibname = $vmhbaId.Driver}) + $driverVib = $esxcli.software.vib.get.Invoke(@{vibname = $vibnamefixed}) } $Info.VibVersion = $driverVib.Version }