Main example
List instances
# All instances of Win32_PnPDevicePropertySint16Array, with the main properties
Get-CimInstance -ClassName Win32_PnPDevicePropertySint16Array |
Select-Object -Property DeviceID, Key, KeyName, TypeExamples
Filter with WQL
# WQL filter evaluated by the provider: Type = 0 (Empty)
Get-CimInstance -ClassName Win32_PnPDevicePropertySint16Array -Filter 'Type = 0' |
Select-Object -Property DeviceID, Key, KeyName, TypeThe filter is evaluated by the WMI provider: less data is transferred than with Where-Object.
Decode numeric values
# Lookup table for Type (values documented by Microsoft)
$typeName = @{
0 = 'Empty'
1 = 'Null'
2 = 'SByte'
3 = 'Byte'
4 = 'Int16'
5 = 'UInt16'
6 = 'Int32'
7 = 'Uint32'
8 = 'Int64'
9 = 'UInt64'
10 = 'Float'
11 = 'Double'
12 = 'Decimal'
13 = 'Guid'
14 = 'Currency'
15 = 'Date'
16 = 'FileTime'
17 = 'Boolean'
18 = 'String'
19 = 'SecurityDescriptor'
20 = 'SecurityDescriptorString'
21 = 'DEVPROPKEY'
22 = 'DEVPROPTYPE'
23 = 'Error'
24 = 'NTStatus'
25 = 'StringIndirect'
4098 = 'SByteArray'
4099 = 'Binary'
4100 = 'Int16Array'
4101 = 'UInt16Array'
4102 = 'Int64Array'
4103 = 'UInt64Array'
4104 = 'FloatArray'
4105 = 'DoubleArray'
4106 = 'DecimalArray'
4107 = 'GuidArray'
4108 = 'CurrencyArray'
4109 = 'DateArray'
4110 = 'FileTimeArray'
4111 = 'BooleanArray'
4112 = 'StringList'
4113 = 'SecurityDescriptorList'
4117 = 'ErrorArray'
4118 = 'NTStatusArray'
4119 = 'StringIndirectList'
4120 = 'Unknown - check in devpropdef.h'
8210 = 'SecurityDescriptorStringList'
8211 = 'DEVPROPKEYArray'
8212 = 'DEVPROPTYPEArray'
8217 = 'TBD'
}
Get-CimInstance -ClassName Win32_PnPDevicePropertySint16Array |
Select-Object -Property @(
'DeviceID'
'Key'
'KeyName'
@{ Name = 'Type'; Expression = { $typeName[[int]$_.Type] } }
)Query a remote computer (CIM session)
review before running# Name of the remote computer
$computerName = 'SERVER01'
# The CIM session (WSMan by default) can be reused for several queries
$cimSession = New-CimSession -ComputerName $computerName
try {
Get-CimInstance -CimSession $cimSession -ClassName Win32_PnPDevicePropertySint16Array |
Select-Object -Property DeviceID, Key, KeyName, Type
} finally {
Remove-CimSession -CimSession $cimSession
}WSMan (WinRM) is used by default. For a host without WinRM, create the session with -SessionOption (New-CimSessionOption -Protocol Dcom). Add -Credential to use another account.
Show the class structure
# Class structure: properties, types and flags (Key, ReadOnly…)
$cimClass = Get-CimClass -ClassName Win32_PnPDevicePropertySint16Array
$cimClass.CimClassProperties |
Select-Object -Property Name, CimType, FlagsProperties
| Name | Type | Access | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Data# | sint16[] | read | The property value. Code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DeviceID# | string | read | Identifies the PnP device. Code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Key# | string | read | The value of the Key Name-Value pair that identifies the Data property. Code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| KeyName# | string | read | The name of the Key Name-Value pair that identifies the Data property. Code | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Type# | uint32 | read | The type of the Data property. The possible values are. Values (52)
Code |
Inheritance
Superclass chain
- Win32_PnPDeviceProperty
- Win32_PnPDevicePropertySint16Array
Known subclasses
No known subclass.
Requirements
- Namespace
- root/cimv2
- Minimum client
- Windows 10 [desktop apps only]
- Minimum server
- Windows Server 2016
- MOF file
- Cimwin32.mof
- DLL
- CIMWin32.dll
Microsoft source
Descriptions, properties and methods come from the Microsoft documentation (MicrosoftDocs/win32 repository), published under the CC BY 4.0 licence. Formatting and translations are specific to this site; the PowerShell examples are written for it.