Is it possible to get the VHDX path of a given mountpoint when the VHDX is detached?

My test setup:

  1. 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 file C:mydisk.vhdx

  2. Create a directory to use as mount-point.

    Let’s call that directory C:mymountpoint

  3. 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
    
  4. 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)?