I was struggling with Powershell and after digging into the internet I could not find my answer. In Powershell, how can I get the list of devices which they have a similar substring in their device ids?
The pseudo-code should be like
Get-PnpDevie if(InstanceId includes (USB\234FA))
CodePudding user response:
Use the Where-Object
cmdlet to filter the output from Get-PnpDevice
based on the InstanceId
property:
Get-PnpDevice |Where-Object InstanceId -like '*USB\234FA*'