Disk information

(imported topic written by jeko1791)

Hi,

I’m trying to retrieve a property that will return to me the “Size” "Partitions "and “Caption” of each Physical disk on Windows systems. When I try to tie more than 1 wmi query together, I get duplicate results:

if (exists wmi) then (string values of selects “Caption from Win32_DiskDrive” of wmi,string values of selects “Size from Win32_DiskDrive” of wmi) else (nothing)

VMware Virtual disk SCSI Disk Device, 16105098240

VMware Virtual disk SCSI Disk Device, 42944186880

VMware Virtual disk SCSI Disk Device, 16105098240

VMware Virtual disk SCSI Disk Device, 42944186880

Evaluation time: 333.167 ms

Evaluates to plural object of type ( string, string )

I only have a C: and D: drive on this server. I cannot figure out how to format this relevance to get clean results. Any ideas?

(imported comment written by BenKus)

The reason you are getting 4 results is because you have two results for each query and the “,” causes the cross-product… Try this:

q: if (exists wmi) then (string value of property “caption” of it, (string value of property “size” of it as integer / 1024/1024/1024) as string & " GB") of (select objects “Caption, size from Win32_DiskDrive” of wmi) else nothings

Ben

(imported comment written by jeko1791)

Excellent. thanks Ben, that worked perfectly.