Tuesday, 6 August 2013

How to get WMI object from a WMI object reference?

How to get WMI object from a WMI object reference?

Similar to this question except that no answer was given with regards to
the main question of getting an object from reference.
For example:
PS C:\Users\admin> Get-WmiObject -Namespace $namespace -Class $class
...
IsActive : 1
oA: \\.\ROOT\abc\abc\ABC:abc.xyz="tst2"
oB : \\.\ROOT\abc\abc\ABC:abc.xyz="tst3"
PSComputerName : admin-test2
oA and oB are references and therefore come up as strings in powershell.
Is there a way I can get the object they represent using WMI query in
powershell?

No comments:

Post a Comment