Summary: Use Windows PowerShell to identify the letter of a mounted ISO or VHD file in Windows Server 2012 R2 or Windows 8.1.
I know I can mount ISOs and VHD files in Windows 8.1, but is there a way to programmatically know what
the drive letter is without checking the GUI and playing with DiskPart?
Pipe the output of Get-DiskImage to Get-Volume or Get-Disk and Get-Partition:
For an ISO file:
GET-DISKIMAGE filename.iso | GET-VOLUME
For a VHD file:
GET-DISKIMAGE filename.vhd | GET-DISK | GET-PARTITION