When debugging driver issues or identifying hardware components on Windows systems, Linux users often miss the convenience of lspci
. This command provides detailed information about every PCI/PCIe device in the system - crucial when dealing with manufacturer systems (like Dell) that offer multiple hardware configurations for network cards, GPUs, or audio chipsets.
Windows doesn't have a direct single-command equivalent, but offers several powerful tools:
Device Manager (GUI Method)
While not command-line based, the Device Manager provides basic PCI device information:
devmgmt.msc
Right-click any device → Properties → Details tab → Select "Hardware Ids" from the property dropdown.
PowerShell Approach
For scriptable solutions, PowerShell provides comprehensive access:
Get-PnpDevice -PresentOnly | Where-Object { $_.InstanceId -match '^PCI' }
Microsoft's devcon.exe offers CLI functionality similar to lspci:
devcon hwids PCI\*
This outputs vendor/device IDs that can be cross-referenced with the PCI ID Repository.
For basic PCI device listing:
wmic path win32_pnpentity get caption,deviceid
PCI-Z Tool
This lightweight portable tool provides lspci-like output with detailed chipset information, including undocumented hardware.
NirSoft's DevManView
Offers exportable device lists with all hardware IDs and driver information in CSV format.
For developers needing to access PCI data in applications:
// C# example using ManagementObjectSearcher
using System.Management;
var searcher = new ManagementObjectSearcher(
"SELECT * FROM Win32_PnPEntity WHERE DeviceID LIKE 'PCI%'");
foreach (ManagementObject obj in searcher.Get())
{
Console.WriteLine($"Device: {obj["Caption"]}");
Console.WriteLine($"HardwareID: {obj["HardwareID"]}");
}
While Linux's lspci shows human-readable names by default, Windows tools typically require additional steps to resolve vendor/device IDs. The PCI ID database can be downloaded for offline reference in scripts.
This PowerShell script matches PCI IDs to human-readable names:
$devices = Get-PnpDevice -PresentOnly | Where-Object { $_.InstanceId -match '^PCI' }
foreach ($device in $devices) {
$hwIds = $device | Get-PnpDeviceProperty -KeyName 'DEVPKEY_Device_HardwareIds'
$venId = ($hwIds.Data[0] -split 'VEN_')[1].Substring(0,4)
$devId = ($hwIds.Data[0] -split 'DEV_')[1].Substring(0,4)
Write-Output "Device: $($device.FriendlyName)"
Write-Output "Vendor: $venId, Device: $devId"
}
When working with hardware configuration in Windows, especially when diagnosing driver issues or verifying system components, Linux administrators often miss the powerful lspci
utility. Windows does provide several native ways to achieve similar functionality:
Using Device Manager
The most basic approach is through Device Manager:
devmgmt.msc
Right-click any device → Properties → Details tab → Select "Hardware Ids" from the property dropdown.
PowerShell Methods
For more advanced scripting capabilities, PowerShell provides excellent options:
Get-PnpDevice -PresentOnly | Where-Object { $_.InstanceId -match '^PCI' }
For detailed PCI information:
Get-CimInstance -ClassName Win32_PnPEntity |
Where-Object { $_.DeviceID -match 'PCI\\' } |
Select-Object Name, DeviceID, Manufacturer
For developers needing low-level access, the Windows Driver Kit provides:
devcon.exe hwids *
Or for specific PCI devices:
devcon.exe hwids PCI\*
Several excellent third-party tools provide lspci-like functionality:
- PCIVIEW (Microsoft's own tool)
- HWINFO64 (comprehensive hardware analysis)
- AIDA64 Extreme (detailed PCI enumeration)
For programmers needing custom solutions, here's a C# example using WMI:
using System;
using System.Management;
class PCIScanner {
static void Main() {
ManagementObjectSearcher searcher = new ManagementObjectSearcher(
"root\\CIMV2",
"SELECT * FROM Win32_PnPEntity WHERE DeviceID LIKE 'PCI%'");
foreach (ManagementObject queryObj in searcher.Get()) {
Console.WriteLine("Device: {0}", queryObj["Name"]);
Console.WriteLine("DeviceID: {0}", queryObj["DeviceID"]);
}
}
}
Windows PCI device IDs follow the format:
PCI\VEN_xxxx&DEV_xxxx&SUBSYS_xxxxxxxx&REV_xx
Where:
- VEN_xxxx: Vendor ID (e.g., 8086 for Intel)
- DEV_xxxx: Device ID
- SUBSYS: Subsystem ID
- REV: Revision number