Search code examples
powershellwmicim

What is the difference between CIM_USBDevice, CIM_USBHub, and Win32_USBHub?


What is the difference between the CimClass(es) CIM_USB_Device and CIM_USBHub? They both emit the same type and appear to produce the same set of objects?

PS C:\src\t> Get-CimInstance CIM_USBDevice | % { $_.Name }
USB Root Hub (USB 3.0)
Generic USB Hub
USB Composite Device
Genesys Logic USB2.0 Card Reader
USB Composite Device
USB Root Hub
Generic USB Hub
USB Root Hub
PS C:\src\t> Get-CimInstance CIM_USBHub | % { $_.Name }
USB Root Hub (USB 3.0)
Generic USB Hub
USB Composite Device
Genesys Logic USB2.0 Card Reader
USB Composite Device
USB Root Hub
Generic USB Hub
USB Root Hub
PS C:\src\t> Get-CimInstance Win32_USBHub | % { $_.Name }
USB Root Hub (USB 3.0)
Generic USB Hub
USB Composite Device
Genesys Logic USB2.0 Card Reader
USB Composite Device
USB Root Hub
Generic USB Hub
USB Root Hub
PS C:\src\t> Get-CimInstance CIM_USBDevice | gm

   TypeName: Microsoft.Management.Infrastructure.CimInstance#root/cimv2/Win32_USBHub

PS C:\src\t> Get-CimInstance CIM_USBHub | gm

   TypeName: Microsoft.Management.Infrastructure.CimInstance#root/cimv2/Win32_USBHub

PS C:\src\t> Get-CimInstance Win32_USBHub | gm

   TypeName: Microsoft.Management.Infrastructure.CimInstance#root/cimv2/Win32_USBHub

Solution

  • Answer to the question could be drawn from basic reference (see the links below). Another matter is the Microsoft implementation of these concepts.

    Class CIM_USBDevice extends CIM_LogicalDevice; there is a direct known subclass: CIM_USBHub.

    Class CIM_USBHub extends CIM_USBDevice (see Local Class Properties GangSwitched and NumberOfPorts).

    Win32_USBHub class belongs to Win32 schema, i.e. a Microsoft extension to the CIM schema that contains definitions of classes and instances to represent managed objects that exist in a typical Windows environment. See also extension schema: the third layer of the CIM schema, which includes platform-specific extensions of the CIM schema such as Windows, UNIX, and Exchange Server. Also see common model and core model.