Это ...
Get-PnPDevice -Class HIDClass |
where { $_.HardwareID.Contains("HID_DEVICE_SYSTEM_GAME") }
... если синтаксически неверно и должно быть это ...
...
where { $PSItem.HardwareID -Contains ...}
Для операторов сравнения не используется точечная нотация.
Я бы преобразовал эту строку в эту ...
Clear-Host
Get-PnPDevice -Class HIDClass |
ForEach {
$PSItem |
Where-Object {$PSItem.HardwareID -match 'HID_DEVICE'} |
Select-Object -Property FriendlyName, DeviceID, HardwareID, Name, Class
"`n`n"
}
# Results
<#
...
FriendlyName : HID-compliant consumer control device
DeviceID : HID\VID_17A0&PID_0305&MI_03\B&345E789C&0&0000
HardwareID : {HID\VID_17A0&PID_0305&REV_0207&MI_03, HID\VID_17A0&PID_0305&MI_03, HID\VID_17A0&UP:000C_U:0001, HID_DEVICE_SYSTEM_CONSUMER,
HID_DEVICE_UP:000C_U:0001, HID_DEVICE}
Name : HID-compliant consumer control device
Class : HIDClass
...
#>