⚡ PowerShell 5.1+
Get Network Adapters Report
Queries Win32_NetworkAdapter via WMI and reports Network Adapters in a formatted table, with an optional CSV export.
Get-NetworkAdapterReport.ps1
<#
.SYNOPSIS
Reports Network Adapters on this computer via WMI (Win32_NetworkAdapter).
.DESCRIPTION
Queries Win32_NetworkAdapter and displays Name, MACAddress, AdapterType, NetEnabled for each item found.
Use -ExportPath to also save the results to a CSV file.
.PARAMETER ExportPath
Optional path to a .csv file to write the results to.
.EXAMPLE
.\Get-NetworkAdapterReport.ps1
.EXAMPLE
.\Get-NetworkAdapterReport.ps1 -ExportPath C:\Reports\networkadapter.csv
#>
[CmdletBinding()]
param(
[string]$ExportPath
)
$items = Get-CimInstance -ClassName Win32_NetworkAdapter | Select-Object Name, MACAddress, AdapterType, NetEnabled
if (-not $items) {
Write-Host "No Network Adapters found." -ForegroundColor Yellow
return
}
$items | Format-Table -AutoSize
if ($ExportPath) {
$items | Export-Csv -Path $ExportPath -NoTypeInformation -Encoding UTF8
Write-Host "`nExported to $ExportPath" -ForegroundColor Cyan
}