My test setup:
-
Create/attach a VHDX file and create/format a partition in it with your preferred methods, but don’t give the formatted partition a drive letter nor a mount-point.
Let’s call the resulting VHDX fileC:mydisk.vhdx -
Create a directory to use as mount-point.
Let’s call that directoryC:mymountpoint -
Mount the image file into that directory:
Get-DiskImage -ImagePath C:mydisk.vhdx | Get-Disk | Get-Partition | Get-Volume | Get-Partition | Add-PartitionAccessPath -AccessPath C:mymountpoint -
Then detach the image file:
DisMount-DiskImage -ImagePath C:mydisk.vhdx
Now C:mymountpoint is kind of “broken”, but when you reattach the correct VHDX you can access it again.
My question is:
Given C:mymountpoint, how can you get the path of the associated VHDX file (which is currently detached)?