I used Powershell Add-PartitionAccessPath to map a partition in a VHDX file to say c:\temp\mysupport folder.
I am trying to create a function that takes access path as input parameter and remove it. I see Remove-PartitionAccessPath is available. But it expects you to pass disk number, partition number etc.
Wondering if there is a way to map a folder mount point back to partition object, disk objects etc to remove it.
Little bit of googling, I found a way to do it. It is not that straight forward. The blog article Locating Mount points helped me come up with this snippet.
Below is code snippet: