Dmitry Porotnikov / PowerShell: Check if Accelerated Networking Adapter is present within Windows VM

Created Tue, 22 Aug 2023 13:33:40 +0000 Modified Tue, 22 Aug 2023 13:33:40 +0000
70 Words

PowerShell: Check if Accelerated Networking Adapter is present within Windows VM

# You might want to check extra adapters type/names here
$AdapterName = "Mellanox ConnectX-4 Lx Virtual Ethernet Adapter"

$AdapterExists = Get-NetAdapter | Where-Object { $_.InterfaceDescription -match $AdapterName }

if ($AdapterExists) {
    Write-Host "The '$AdapterName' network adapter exists in the system." -ForegroundColor Green
} else {
    Write-Host "The '$AdapterName' network adapter does not exist in the system." -ForegroundColor Red
}