Get-PnpDeviceProperty
Get-PnpDeviceProperty
Gets detailed properties for a PnP device.
Syntaxe
Parameter Set: ByInstanceId
Get-PnpDeviceProperty [[-KeyName] <String[]> ] -InstanceId <String[]> [-CimSession <CimSession[]> ] [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend}[] ] [-InformationVariable <System.String[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>] [ <WorkflowParameters>]
Parameter Set: InputObject (cdxml)
Get-PnpDeviceProperty [[-KeyName] <String[]> ] [-CimSession <CimSession[]> ] [-InformationAction {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend}[] ] [-InformationVariable <System.String[]> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>] [ <WorkflowParameters>]
Description détaillée
The Get-PnpDeviceProperty cmdlet gets detailed properties for a Plug and Play (PnP) device. You can specify a device by instance ID or by using the Get-PnpDevice cmdlet.
A device property is a key-value pair. A property key takes the form {GUID} PID. The property value is one of several types, such as UTF-8, GUID, Uint32, or Boolean. The output object contains the typed data of a value, and the value type. Many properties also have friendly names, in the form of DEVPKEY_XXX.
Paramètres
-CimSession<CimSession[]>
Exécute l'applet de commande dans une session distante ou sur un ordinateur distant. Entrez un nom d'ordinateur ou un objet de session, tels que le résultat d'une applet de commande New-CimSession ou Get-CimSession. La valeur par défaut est la session en cours sur l'ordinateur local.
Alias |
Session |
Requis ? |
false |
Position ? |
named |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
false |
Accepter les caractères génériques ? |
false |
-InformationAction<System.Management.Automation.ActionPreference[]>
Specifies how this cmdlet responds to an information event. Les valeurs acceptables pour ce paramètre sont les suivantes :
-- SilentlyContinue
-- Stop
-- Continue
-- Inquire
-- Ignore
-- Suspend
Alias |
infa |
Requis ? |
false |
Position ? |
named |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
false |
Accepter les caractères génériques ? |
false |
-InformationVariable<System.String[]>
Specifies a variable in which to store an information event message.
Alias |
iv |
Requis ? |
false |
Position ? |
named |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
false |
Accepter les caractères génériques ? |
false |
-InstanceId<String[]>
Specifies an array of unique instance ID of devices.
Alias |
DeviceId |
Requis ? |
true |
Position ? |
named |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
true(ByPropertyName) |
Accepter les caractères génériques ? |
false |
-KeyName<String[]>
Specifies an array of key names.
Alias |
Key |
Requis ? |
false |
Position ? |
1 |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
true(ByPropertyName) |
Accepter les caractères génériques ? |
false |
-ThrottleLimit<Int32>
Spécifie le nombre maximal d'opérations simultanées qui peuvent être établies pour exécuter l'applet de commande. Si ce paramètre est omis ou si la valeur 0
est entrée, Windows PowerShell® calcule un seuil de limitation optimal pour l'applet de commande en fonction du nombre d'applets de commande CIM exécutées sur l'ordinateur. Le seuil de limitation s'applique uniquement à l'applet de commande en cours, non pas à la session ou à l'ordinateur.
Alias |
none |
Requis ? |
false |
Position ? |
named |
Valeur par défaut |
none |
Accepter l'entrée de pipeline ? |
false |
Accepter les caractères génériques ? |
false |
<CommonParameters>
Cette applet de commande prend en charge les paramètres courants : -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer et -OutVariable. Pour plus d'informations, consultez . about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
<WorkflowParameters>
Entrées
Le type d'entrée correspond au type des objets que vous pouvez adresser à l'applet de commande.
Microsoft.Management.Infrastructure.CimInstance#ROOT/Cimv2/Win32_PnPEntity[]
L'objet
Microsoft.Management.Infrastructure.CimInstance
est une classe de wrapper qui affiche les objets WMI (Windows Management Instrumentation). Le chemin après le symbole#
fournit l'espace de noms et le nom de classe de l'objet WMI sous-jacent.
Sorties
Le type de sortie correspond au type des objets que l'applet de commande émet.
System.Int32, Win32_PnPDeviceProperty[]
This cmdlet generates an Int32 WMI success or failure code, or an array of Win32_PnPDeviceProperty objects that represent properties for a PnP device. A Win32_PnPDeviceProperty object contains the following fields:
-- Device. The instance ID for the device with which this property is associated.
-- KeyName. The friendly name for the property. If no friendly name exists, this matches the Key field.
-- Key. The unique [GUID]-ID pairing representing the property.
-- Data. The typed data associated with the key. This value is defined in the classes which inherit from Win32_PnPDeviceProperty. For example, a Win32PnPDevicePropertySint32 object would be returned for an Int32 property. Data would be an Int32 value in this case.
-- Type. The type of the binary data. This is defined in the PnpDeviceProperty.Type enum.
Remarques
The objects returned by Get-PnpDeviceProperty are all of the (WMI Object) Win32_PnPDeviceProperty type. They are always of a WMI class inherited from Win32_PnPDeviceProperty. For example, a device may contain a String and signed Int32 properties. The cmdlet returns a Win32_PnPDeviceProperty array, where the first object in the array is a Win32_PnPDevicePropertyString object and the second is a Win32_PnPDevicePropertySint32 object. For each object type, there is a Data variable, of the given type, which contains the value of the property.
The following is a full list of possible WMI classes and the type of the Data variable:
-- Win32_PnPDevicePropertyUint8. Uint8.
-- Win32_PnPDevicePropertyUint16. Uint16.
-- Win32_PnPDevicePropertyUint32. Uint32.
-- Win32_PnPDevicePropertyUint64. Uint64.
-- Win32_PnPDevicePropertySint8. Sint8.
-- Win32_PnPDevicePropertySint16. Sint16.
-- Win32_PnPDevicePropertySint32. Sint32.
-- Win32_PnPDevicePropertySint64. Sint64.
-- Win32_PnPDevicePropertyString. String.
-- Win32_PnPDevicePropertyBoolean. Boolean.
-- Win32_PnPDevicePropertyReal32. Real32.
-- Win32_PnPDevicePropertyReal64. Real64.
-- Win32_PnPDevicePropertyDateTime. DateTime.
-- Win32_PnPDevicePropertySecurityDescriptor. Win32_SecurityDescriptor.
-- Win32_PnPDevicePropertyBinary. Uint8 array.
-- Win32_PnPDevicePropertyUint16Array. Uint16 array.
-- Win32_PnPDevicePropertyUint32Array. Uint32 array.
-- Win32_PnPDevicePropertyUint64Array. Uint64 array.
-- Win32_PnPDevicePropertySint8Array. Sint8 array.
-- Win32_PnPDevicePropertySint16Array. Sint16 array.
-- Win32_PnPDevicePropertySint32Array. Sint32 array.
-- Win32_PnPDevicePropertySint64Array. Sint64 array.
-- Win32_PnPDevicePropertyStringArray. String array.
-- Win32_PnPDevicePropertyBooleanArray. Boolean array.
-- Win32_PnPDevicePropertyReal32Array. Real32 array.
-- Win32_PnPDevicePropertyReal64Array. Real64 array.
-- Win32_PnPDevicePropertyDateTimeArray. DateTime array.
-- Win32_PnPDevicePropertySecurityDescriptorArray. Win32_SecurityDescriptor array.
Exemples
Example 1: Get properties for a device by using an ID
This command gets the PnP device properties for the device that has the specified ID.
PS C:\> Get-PnpDeviceProperty -InstanceId 'SWD\PRINTENUM\{E82E5EFD-6616-4E4F-9A96-7D94554A8BF0}'
Example 2: Get properties for a device by using the pipeline
This command uses the Get-PnpDevice cmdlet to get the PnP device that has the specified ID. The command passes that object to the current cmdlet by using the pipeline operator. The current command gets the device properties for that device.
PS C:\> Get-PnpDevice -InstanceId 'SWD\PRINTENUM\{E82E5EFD-6616-4E4F-9A96-7D94554A8BF0}' | Get-PnpDeviceProperty
Example 3: Get properties by using GUID-ID pairs
This command gets some of the properties of the PnP device that has the specified instance ID. The command specifies three key names of properties to get. The command specifies names as GUID-ID pairs.
PS C:\> Get-PnpDeviceProperty -KeyName '{A45C254E-DF1C-4EFD-8020-67D146A850E0} 2', '{A45C254E-DF1C-4EFD-8020-67D146A850E0} 10', '{4340A6C5-93FA-4706-972C-7B648008A5A7} 3' -InstanceId 'SWD\PRINTENUM\{E82E5EFD-6616-4E4F-9A96-7D94554A8BF0}'
Example 4: Get properties by using DEVPKEY names
This command gets some of the properties of the PnP device that has the specified instance ID. The command specifies three key names of properties to get. The command specifies names as DEVPKEY short names.
PS C:\> Get-PnpDeviceProperty -KeyName 'DEVPKEY_Device_DeviceDesc', 'DEVPKEY_Device_ClassGuid', 'DEVPKEY_Device_ProblemCode' -InstanceId 'SWD\PRINTENUM\{E82E5EFD-6616-4E4F-9A96-7D94554A8BF0}'