You could automate diskpart
in PowerShell to determine the disk IDs and paths, and then use the IDs in a WMI query to determine the partition number. Example:
('list vdisk' | diskpart) -match '\.vhd' | % {
$a = $_.Trim() -split ' +', 5
New-Object -Type PSObject -Property @{
'ID' = $a[1] -replace 'Disk '
'Path' = $a[4]
}
} | % {
$flt = "DeviceID='\\\\.\\PHYSICALDRIVE$($_.ID)'"
$partitions = gwmi Win32_DiskDrive -Filter $flt | select -Expand Partitions
"{0}`t{1}`t{2}" -f $_.ID, $partitions, $_.Path
}