CIM_USBDevice、CIM_USBHub 和 Win32_USBHub 有什么区别?
What is the difference between CIM_USBDevice, CIM_USBHub, and Win32_USBHub?
CimClass(es) CIM_USB_Device
和 CIM_USBHub
有什么区别?它们都发出相同的类型并且似乎产生相同的对象集?
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
如果代码使用 Get-WMIObject
cmdlet 查询 WMI,显然 Win32_USBHub
是 class 到 return 的遗留兼容性,而 CIM_USBHub
是它的直接 "new model" superclass,与Get-CIMInstance
一起使用。 CIM_USBDevice
是 CIM_USBHub
的超级 class,如果 class 内部化,是否应该有任何其他不是 USB 集线器的 USB 设备,例如通过 USB 连接的未知设备,它会出现在 CIM_USBDevice
的查询中,但不会出现在 CIM_USBHub
.
中
问题的答案可以从基本参考资料中得出(见下面的链接)。另一件事是 Microsoft 对这些概念的实施。
ClassCIM_USBDevice
extends CIM_LogicalDevice
;有一个直接已知的子类:CIM_USBHub
.
Class CIM_USBHub
扩展 CIM_USBDevice
(请参阅本地 Class 属性 GangSwitched
和 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 和核心模型。
CimClass(es) CIM_USB_Device
和 CIM_USBHub
有什么区别?它们都发出相同的类型并且似乎产生相同的对象集?
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
如果代码使用 Get-WMIObject
cmdlet 查询 WMI,显然 Win32_USBHub
是 class 到 return 的遗留兼容性,而 CIM_USBHub
是它的直接 "new model" superclass,与Get-CIMInstance
一起使用。 CIM_USBDevice
是 CIM_USBHub
的超级 class,如果 class 内部化,是否应该有任何其他不是 USB 集线器的 USB 设备,例如通过 USB 连接的未知设备,它会出现在 CIM_USBDevice
的查询中,但不会出现在 CIM_USBHub
.
问题的答案可以从基本参考资料中得出(见下面的链接)。另一件事是 Microsoft 对这些概念的实施。
ClassCIM_USBDevice
extends CIM_LogicalDevice
;有一个直接已知的子类:CIM_USBHub
.
Class CIM_USBHub
扩展 CIM_USBDevice
(请参阅本地 Class 属性 GangSwitched
和 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 和核心模型。