How to Mount and Dismount an ISO Using PowerShell

Mounting an ISO assigns it a drive letter so you can browse its contents in File Explorer. ISO files can be mounted using the “Mount” context menu. This article explains how to mount an ISO using PowerShell.

Mount and Dismount ISO Using PowerShell

Suppose you want to mount the ISO file “E:\Windows ISO\Win11_23H2_Enterprise.iso”, open PowerShell and run the following command.

Example 1: Mount an ISO

To mount the ISO, run the following command:

Mount-DiskImage -ImagePath "E:\Windows ISO\Win11_23H2_Enterprise.iso"

mount iso powershell

Open This PC and see if the ISO is mounted.

mount iso powershell - this pc drive letter

Example 2: Mount an ISO and obtain its drive letter

To mount the ISO and get the assigned drive letter, run the following:

Mount-DiskImage -ImagePath "E:\Windows ISO\Win11_23H2_Enterprise.iso" | Get-Volume

mount iso powershell get drive letter

Example 3: Mount an ISO and obtain its driver letter and other information

Run the two commands below to mount the ISO and get the drive letter and device information.

$info = Mount-DiskImage -ImagePath "E:\Windows ISO\Win11_23H2_Enterprise.iso"

write-output ($info | get-volume) $info

mount iso powershell get details and drive info

Example 4: Dismount an ISO Using ImagePath

To eject (dismount) an ISO by mentioning the ISO file name, run:

Dismount-DiskImage -ImagePath "E:\Windows ISO\Win11_23H2_Enterprise.iso"

dismount iso powershell

Example 5: Dismount an ISO Using DevicePath

To eject (dismount) an ISO by mentioning the device path, run:

Dismount-DiskImage -DevicePath "\\.\CDROM0"

(In this example, \.\CDROM0 is the device path of the mounted ISO, as shown in the earlier output.)

dismount iso using devicepath

Example 6: Dismount multiple ISO drive letters pointing to the same ISO

If the same ISO was mounted multiple times using PowerShell, many drive letters would have been assigned. You may wonder how to dismount each ISO drive letter that points to the same image.

For example, if you run the following command, you’ll see the list of ISO drive letters (and CD-ROM drive letters.)

Get-CimInstance Win32_LogicalDisk | ?{ $_.DriveType -eq 5}

get cd-rom and iso drive letters

As you can see in the above output, there are several ISO drive letters. So, run the Dismount command many times. Or run the Dismount command in the “foreach” loop, as below, so that every ISO drive letter (that points to the same ISO image) is removed.

$numitems = Get-CimInstance Win32_LogicalDisk | ?{ $_.DriveType -eq 5}

foreach($item in $numitems){Dismount-DiskImage -ImagePath "E:\Windows ISO\Win11_23H2_Enterprise.iso"}

I hope the information in this article helped.

One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded in 2005.

Leave a Comment