Take for example the following query:
ASSOCIATORS OF {Win32_DiskPartition.DeviceID="Disk #2, Partition #0"} WHERE AssocClass = Win32_LogicalDiskToPartition
It works fine and returns a matching list with (in my case) a single logical drive, F :. However, if I change the method of specifying an object in this query, for example, as follows:
ASSOCIATORS OF {Win32_DiskPartition.DiskIndex=2} WHERE AssocClass = Win32_LogicalDiskToPartition
I get an "Invalid Object Path" error (in PowerShell). The DiskIndex field certainly exists (the query "SELECT * FROM Win32_DiskPartition WHERE DiskIndex = 2" returns the one and only partition that is on my disk number 2), so what happened to this request? I also tried using some other classes of the Win32_DiskPartition class, but none of them worked in the "ASSOCIATORS OF" query. There is no information about any restrictions on ObjectPath anywhere on the Internet (that is, where Google sent me). Moreover, I found an article where the author clearly says:
This classifier can be any property from the source WMI class.
So what is wrong with this request modification?
source share