dorssel / usbipd-win

Windows software for sharing locally connected USB devices to other machines, including Hyper-V guests and WSL 2.
GNU General Public License v3.0
3.69k stars 232 forks source link

List Only Connected Devices #852

Open jtmullen opened 9 months ago

jtmullen commented 9 months ago

I have been using usbipd for connecting devices to wsl. Since updating to a new version with the changed syntax one thing that has been a bit frustrating is that the usbipd list command prints out all the connected devices and persisted devices (which in my case is dozens). The old usbipd wsl list command just showed the connected devices. The connected devices is all I am interested in seeing so I can get the busid, and now I have to scroll up to find them since they end up off screen due to the long list of persisted devices.

I think an option on the list command to only list connected devices would be very helpful.

dorssel commented 9 months ago

That makes sense, but you'll have to wait a bit. It's not high on the priority list.

For the time being, you can remove some of the persisted devices (if you don't need/use) them anymore with usbipd unbind --guid, or maybe even all of them in one go with usbipd unbind --all. Alternatively, you could list as outlined in https://github.com/dorssel/usbipd-win/wiki/Automation#powershell. Something like

Get-UsbipdDevice | Where-Object {$_.IsConnected} | Format-Table BusId,Description,IsBound