Files
PowerCLI-Example-Scripts/Scripts/NVME Info.ps1
Sander c506bf400a Rearranged notes section
Tabs and spaces cleaned up
2019-09-30 21:12:56 +02:00

28 lines
1.1 KiB
PowerShell

<#
.NOTES
===========================================================================
Created by: Alan Renouf
Organization: VMware
Blog: http://virtu-al.net
Twitter: @alanrenouf
===========================================================================
#>
Foreach ($vmhost in Get-VMHost) {
$esxcli = get-esxcli -V2 -vmhost $vmhost
Write-Host "Host: $($vmhost.name)" -ForegroundColor Green
$devices = $esxcli.nvme.device.list.Invoke()
Foreach ($device in $devices) {
$nvmedevice = $esxcli.nvme.device.get.CreateArgs()
$nvmedevice.adapter = $device.HBAName
$esxcli.nvme.device.get.invoke($nvmedevice) | Select-Object ModelNumber, FirmwareRevision
$features = $esxcli.nvme.device.feature.ChildElements | Select-object -ExpandProperty name
ForEach ($feature in $features){
Write-Host "Feature: $feature" -ForegroundColor Yellow
$currentfeature = $esxcli.nvme.device.feature.$feature.get.CreateArgs()
$currentfeature.adapter = $device.HBAName
$esxcli.nvme.device.feature.$feature.get.Invoke($currentfeature)
}
}
}