Get-pnpdevice in Windows 8.1

Welcome Forums General PowerShell Q&A Get-pnpdevice in Windows 8.1

This topic contains 3 replies, has 3 voices, and was last updated by

js
 
Participant
6 months, 4 weeks ago.

  • Author
    Posts
  • #101073
    Pj

    Participant
    Points: 0
    Rank: Member

    Is there any way to get this cmdlet in windows 8.1? If not what would the alternative be for this line...

    Get-PnpDevice -Class Ports -FriendlyName MOXA* | Select-Object -Property FriendlyName
    
  • #101076
    Jon

    Participant
    Points: 37
    Rank: Member

    get-pnpdevice is getting it's information from TypeName: Microsoft.Management.Infrastructure.CimInstance#ROOT/cimv2/Win32_PnPEntity

    So you could use cim or wmi cmdlets to call win32_pnpentity

  • #101079
    Pj

    Participant
    Points: 0
    Rank: Member

    With that information I have arrived at the following for a replacement string. Thanks for the fast answer

    $filter = 'Moxa UPort Com Port'
    $MoxaPorts = Get-WmiObject win32_pnpentity -Filter "name LIKE '%$filter%'" | Select-Object Name
    return $MoxaPorts
    
    • #101088
      js

      Participant
      Points: 326
      Helping Hand
      Rank: Contributor

      I was going to suggest this, but other properties get returned anyway, lol.

      get-wmiobject -query "select name from win32_pnpentity where name like '%$filter%'"
      

The topic ‘Get-pnpdevice in Windows 8.1’ is closed to new replies.