USBF_PortInfo (Industry 8.1)
7/8/2014
Review the syntax, members, and examples of the USBF_PortInfo WMI provider class for Windows Embedded 8.1 Industry (Industry 8.1).
This class retrieves current information about the USB ports on a device.
Syntax
class USBF_PortInfo {
[key, read] string PortLocationPath;
[key, read] Uint32 PortNumber;
[read] string HubLocationPath;
[read] boolean HasDeviceAttached;
[read] UInt32 DeviceClassID;
[read] UInt32 DeviceVendorID;
[read] UInt32 DeviceProductID;
};
Members
The following table lists the properties that belong to this class.
Properties
Property |
Data type |
Qualifiers |
Description |
---|---|---|---|
PortLocationPath |
string |
[key, read] |
Specifies a unique USB port location path in the following format: PCIROOT(PciBusNumber)#PCI(PciDeviceNumber + PciFunctionNumber)#USBROOT(HubPortNumber)#USB(HubPortNumber[0]) … #USB(HubPortNumber [X]) For example: PCIROOT(0)#PCI(1D00)#USBROOT(0)#USB(1)#USB(8) |
PortNumber |
UInt32 |
[key, read] |
Specifies the USB hub controller port number assigned by the system. |
HubLocationPath |
string |
[read] |
Specifies the hub ID that defines the top-down parent child position of the port. For example: PCIROOT(0)#PCI(1D00)#USBROOT(0)#USB(1) |
HasDeviceAttached |
Boolean |
[read] |
Indicates if that there is a USB device attached to the USB port. The value of the DeviceClassID, DeviceVendorID, and DeviceProductID properties are valid only when HasDeviceAttached is set to true. |
DeviceClassID |
UInt32 |
[read] |
Specifies the class ID for the USB device currently attached. |
DeviceVendorID |
UInt32 |
[read] |
Specifies the vendor ID for the USB device currently attached. |
DeviceProductID |
UInt32 |
[read] |
Specifies the product ID for the USB device currently attached. |
Example
The following example demonstrates how to use the USBF_PortInfo class in a Windows PowerShell script.
Get port information
#Get USB port information
cls
$WmiNS = "root\standardcimv2\embedded"
$Ports = Get-WmiObject -namespace $wmiNS -class USBF_PortInfo
Echo "Total " $Ports.Count "USB Ports"
#List all ports and attached device
$Ports | Format-Table Port*, HasDeviceAttached, Device*
See Also
Reference
USB Filter WMI provider reference