Advertisement
menixator

Mounting ISO files with powershell

Aug 1st, 2014
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. Mounting ISO files with powershell
  2.  
  3. You can mount ISO files easily with powershell's Mount-DiskImage cmdlet.
  4. Mount-DiskImage FULL_PATH_TO_ISO_FILE
  5.  
  6. FULL_PATH_TO_ISO_FILE SHOULD BE THE FULL PATH. NO RELATIVE PATHS WORK HERE.
  7. Meaning,
  8.  
  9. Mount-DiskImage .\randomisofile.iso
  10.  
  11. Wont work. But dont fret. We've got ways around that.
  12.  
  13. Mount-DiskImage $pwd\randomisofile.iso
  14.  
  15. $pwd is the variable in powershell that holds the current working directory.
  16.  
  17.  
  18. Dont forget to add quotes when necessary:
  19. Mount-DiskImage "$pwd\Some Iso File With Spaces In It's name.iso"
  20.  
  21.  
  22. Unmounting the files:
  23.  
  24. Right now, on my machine which has Win8 Installed, I can just right click the drive and Select Eject to Unmount it.
  25.  
  26. With powershell, I can do this to dismount it:
  27.  
  28. Get-Volume DRIVE_LETTER|Get-DiskImage|Dismount-DiskImage
  29.  
  30. DRIVE_LETTER should be just a letter or a bunch of letters. "CDEF"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement