Get Hard Drive Info: Volume Name, Disk Type, Bus Type


can someone help me integrate this powershell script into relevance to find the volume name, disk type and bus type information .

[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.Storage.Vds”) | Out-Null
$oVdsServiceLoader = New-Object Microsoft.Storage.Vds.ServiceLoader
$oVdsService = $oVdsServiceLoader.LoadService($null)
$cDisks = ($oVdsService.Providers |% {$.Packs}) |% {$.Disks}
$cPacks = $oVdsService.Providers |% {$_.Packs}

write-host “Disk-FriendlyName,Disk-Name,Disk-Status,Disk-BusType”

foreach($oPack in $cPacks)
If($oPack.Status -eq “Online”)

    foreach($oDisk in $oPack.Disks)
        "$($oDisk.Friendlyname), $($oDisk.Name),$($oDisk.Status), $($oDisk.BusType)" 

    foreach($oVolume in $oPack.Volumes)
       "`t$($oVolume.AccessPaths), $($oVolume.Label)" | out-file .\disk.bustype.csv






First of all, you don’t need powershell to determine most of this info.

You can use the existing disk inspector to get some of it, and you can use WMI to get the rest.

You cannot use powershell in relevance at all. Relevance is purely read only, while PowerShell is not.

If there is something that is not possible in pure Relevance, then you can get around this by running an action periodically on an endpoint that outputs the results of a command, which could be powershell, to a file… You can then read that file using relevance. This is the primary way to get around any relevance limitations.

Try this in the Fixlet Debugger:

selects "* from Win32_DiskDrive WHERE size!='' " of wmi

And this:

selects "InterfaceType,MediaType,DeviceID,Model from Win32_DiskDrive WHERE size!='' " of wmi

There are tools that you can use to interactively explore the data that is available in WMI. Once you find the data that you are looking for, you can write relevance against it to return that data.

Also, you mentioned creating a “property”. I would recommend creating an analysis and have this be a property within that analysis. I would not recommend creating normal “properties” that are not apart of an analysis unless you must do to some way the property is going to be used later, which in that case you can take the property from the analysis and make it global property at that point.

See here: