Unless you are looking for some specific script but this is the manual way.
There should be information about the bus and device ID in the vmx configuration file of the VM which takes the form
pciPassthru[n].id = "nn:nn.n"
So you should be able to see as well in the vmware.log or from the ESXi host client as the passthrough device should have been pre-assigned and not randomly picked at startup.
pciPassthru0.id = "09:00.0"
Thanks for the quick response the device is not in pass-through mode it is a usb device attached to the vm via the gui so I dont think the above line exists in the vmx file.
Will take a look at the vmware.log and see what we can see.
Sorry about that I misinterpreted the USB pass through. So it is a straightforward USB passthrough just like USB thumb drives.
Yes, the vmware.log might be the next best thing. For Fusion/Workstation VMs, usually there is a path and sometimes a serial number of the device. I would think it would be the same for ESXi VMs to allow autoconnect either by path or by vendor/device ID. So either the path or serial number would help along the way.
Assuming the path is shown in the vmware.log, just plug the same serial number USB device to the same VM using different ports to work out the different paths.