Hi johnch99,
You can sort the result by the FriendlyName property.
Get-PnpDevice -FriendlyName 'USB4*' -class 'USB' | Sort-Object -Property FriendlyName
Best Regards,
Ian Xue
If the Answer is helpful, please click "Accept Answer" and upvote it.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
In Device Manager, and you can change the "View" and select Device by connection. With this view you can see how devices are connected or chained together in cascade view. In Powershell when I run Get-PnpDevice -FriendlyName 'USB4*' -class 'USB' I get this output:
Status Class FriendlyName
OK USB USB4(TM) Host Router (Microsoft)
OK USB USB4(TM) Host Router (Microsoft)
OK USB USB4 Root Router (1.0)
OK USB USB4 Root Router (1.0)
But in Device Manager, View by Device by connection I like to arrange like this:
Status Class FriendlyName
OK USB USB4(TM) Host Router (Microsoft)
OK USB USB4 Root Router (1.0)
OK USB USB4(TM) Host Router (Microsoft)
OK USB USB4 Root Router (1.0)
How can this be done Powershell and save in a text file?
Hi johnch99,
You can sort the result by the FriendlyName property.
Get-PnpDevice -FriendlyName 'USB4*' -class 'USB' | Sort-Object -Property FriendlyName
Best Regards,
Ian Xue
If the Answer is helpful, please click "Accept Answer" and upvote it.
(Sorry if this is being posted twice. I seem to have a bug)
You can pipe your result to an export. Examples
Get-PnpDevice -FriendlyName 'USB4*' -class 'USB' | Export-CSV -Path <somepath>
Get-PnpDevice -FriendlyName 'USB4*' -class 'USB' | Out-File -FilePath <somepath>
Hello johnch99, you can pipe the results to the export option you want to use.
Examples:
Get-PnpDevice -FriendlyName 'USB4*' -class 'USB' | Export-CSV -Path <some path>
Get-PnpDevice -FriendlyName 'USB4*' -class 'USB' | Out-File -FilePath <some path>