Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
The Get-PnpDevice command in PowerShell is a powerful tool for managing and retrieving information about Plug and Play (PnP) devices in the Windows environment. It allows users to easily query and manipulate device properties, drivers, and other related information. This article aims to provide a comprehensive guide on how to effectively use the Get-PnpDevice command in PowerShell, specifically tailored for the Windows operating system.
Examples:
Retrieving a list of all PnP devices:
Get-PnpDevice
This command will return a list of all PnP devices currently connected to the Windows system. The output will include properties such as DeviceID, Status, Manufacturer, and more.
Filtering devices based on specific criteria:
Get-PnpDevice | Where-Object {$_.Status -eq 'OK'}
This example demonstrates how to filter the list of devices to only display those with a status of "OK". You can modify the filter criteria to match your specific requirements.
Retrieving device properties for a specific device:
Get-PnpDevice -InstanceId 'PCI\VEN_8086&DEV_15BB&SUBSYS_00008086&REV_00\3&11583659&0&C8'
By providing the InstanceID of a device, you can retrieve detailed information about that specific device. The InstanceID can be obtained from the output of the previous Get-PnpDevice command.
Updating device properties:
$device = Get-PnpDevice -InstanceId 'PCI\VEN_8086&DEV_15BB&SUBSYS_00008086&REV_00\3&11583659&0&C8'
$device | Set-PnpDevice -FriendlyName 'New Device Name'
This example shows how to update the FriendlyName property of a device. You can modify other properties by specifying different parameters with the Set-PnpDevice command.