What PowerShell command shows which PCIe lanes a device uses?

0
0
Asked By MellowCedar42 On

I'm trying to remember a PowerShell or Command Prompt command that showed how devices are connected to a PC—such as whether they connect through the CPU or chipset—and how many PCIe lanes each device is using. I initially thought it might be related to listing Plug and Play devices, but I'm looking for the command that displays the bus or lane path information.

2 Answers

Answered By SilverMaple8 On

The command you remembered may have been a script called `cpudirect.ps1`, run with `irm ... | iex`. It displays information about whether devices are connected through the CPU or chipset and their lane allocation. Be careful with commands that download and immediately execute a remote script—review the script locally first, then run it if you trust its contents.

MellowCedar42 -

That was the one I was trying to find. I had been searching with the wrong terms, so thanks! I’ll inspect the script before running it.

Answered By QuietOrbit7 On

You can list PCI-related devices with a CIM query like this: `(Get-CimInstance Win32_PnPEntity | Where-Object {$_.DeviceID -like "*PCI*"}) | Select-Object Name,@{Name="Path/Bus";Expression={($_.DeviceID -split '\')[1]}},Status | Format-Table -AutoSize`. This shows the device name, part of its PCI path, and status, although it may not directly report the negotiated lane width.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.