0

I'm using a powershell query with gwmi to retrieve some info on usb controllers, i can get most of the infos from the object properties, but the property "Parent" is returning empty, while in windows device manager its not empty. Does someone knows why ? here is my query:

gwmi Win32_USBControllerDevice |%{[wmi]($_.Dependent)} | Where-Object {$_.Service -match 'usbaudio' } | Sort Manufacturer,Name,Parent | Ft -GroupBy Manufacturer Name,Parent

Screenshot ex:

DoomneT
  • 1
  • 3
  • Try Get-Alias : https://stackoverflow.com/questions/31443694/what-is-the-relationship-between-gwmi-and-get-wmiobject – jdweng Oct 19 '22 at 07:16
  • I don't have a problem with gwmi or the alias Get-WmiObject, the link you posted has nothing to do with my question – DoomneT Oct 19 '22 at 08:06
  • Is the parent an object or an alias? – jdweng Oct 19 '22 at 08:46
  • You can have a look in the screenshot above, as windows calls it in the device manager its a property, or maybe an object property idk, but its the same as manufacturer or Name or Hardware ID – DoomneT Oct 19 '22 at 09:38
  • Each hardware device has a 20 byte header. There are additional optional info that the driver can add which is not part of the header. The Where-Object is only getting the standard 20 byte header. The Device manager is showing both the standard 20 byte info and the custom info. – jdweng Oct 19 '22 at 09:57
  • Ok so you mean the parent property is not part of the header? do you know how i can retrieve the value of the property "parent" via PS ? – DoomneT Oct 19 '22 at 11:17
  • I'm say the details (device manager) in the screenshot is the Alias. The Get-Object is only showing the General Tab in Device Manager. A hardware device in Windows has a header block which is memory mapped at the lower portion of memory at offsets of 0x2000 and first 4 bytes are AA55. Some info is in the block and other inside the driver. See : https://en.wikipedia.org/wiki/PCI_configuration_space?force_isolation=true – jdweng Oct 19 '22 at 11:31
  • Ok thanks for the explanations, but this is still not helping me, if you could show me an example with PS, i mean it should be a simple code, why i can retrieve the name value, but not the parent value – DoomneT Oct 19 '22 at 12:44

0 Answers0