How to convert mount point volumes GUID to actual path?

I use this code to get Path, VolumeLabel, TotalSize, FreeSpace:

gwmi -ComputerName $ComputerName -namespace root\MSCluster MSCluster_DiskPartition -Credential $cred -Authentication PacketPrivacy | Format-Table Path, VolumeLabel, TotalSize, FreeSpace -AutoSize 

Output:

 Path VolumeLabel TotalSize FreeSpace ---- ----------- --------- --------- U: Archive1 4194184 379651 \\?\Volume{76795fb2-254e-454d-a95a-739018690cf4} Archive3 4194184 524883 X: Archive2 4194184 735366 \\?\Volume{57e93910-60f9-44b9-8d9d-29d506e1e3d7} Archive4 4194184 1483274 

How can I get the real path (or maybe drive name) of the mount point from the volume GUID?

enter image description here

I am trying to use the .GetRelated class, but without success. Can someone help me with this?

+6
source share
1 answer

I checked it with a vhd file that was installed on C:\test_vhd\ . This seems to work.

 Get-WmiObject -class Win32_Volume -computername localhost | ? { $PSItem.DeviceID.Contains("f91957ea-bb2f-11e4-9464-028037ec0200") } | Select-Object Name Name ---- C:\test_vhd\ 

enter image description here

0
source

Source: https://habr.com/ru/post/982739/


All Articles