How do I get the drive letter for the ISO I mounted with Mount-DiskImage

Try this:

$mountResult = Mount-DiskImage D:\ISOs\clonezilla-live-1.2.12-10-i486.iso -PassThru
$mountResult | Get-Volume

This will return which drive letter that ISO is assigned to along with other info — from there it’s just a matter of parsing the output.

EDIT:
This will return JUST the drive letter:

$driveLetter = ($mountResult | Get-Volume).DriveLetter

Leave a Comment

File not found.