Get-DiskImage

Get one or more disk image objects (virtual hard disk or ISO).

Syntax
      Get-DiskImage { [-ImagePath] String[] | [-Volume CimInstance] | -DevicePath String[] }
         [-StorageType StorageType] [-CimSession CimSession[]] [-ThrottleLimit Int32]
            [-AsJob] [CommonParameters]

Key
   -AsJob
      Run the cmdlet as a background job.
      Use this parameter to run commands that take a long time to complete.
  
   -CimSession
      Run the cmdlet in a remote session or on a remote computer.
      Enter a computer name or a session object, such as the output of a New-CimSession or
      Get-CimSession cmdlet. The default is the current session on the local computer.

   -DevicePath
      The device path of the ISO or VHD file. You cannot use this parameter with the -ImagePath parameter.
      
   -ImagePath
      The path of the ISO or VHD file. You cannot use this parameter with the -DevicePath parameter.

   -StorageType
      Specifies the type of a disk image: ISO, VHD, VHDx, or Unknown.
      If the -StorageType parameter is not specified or the Unknown type is provided, the storage type is determined by file extension.

   -ThrottleLimit
      The maximum number of concurrent operations that can be established to run the cmdlet.
      If this parameter is omitted or a value of 0 is entered, then PowerShell calculates an optimum
      throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer.
      The throttle limit applies only to the current cmdlet, not to the session or to the computer.

   -Volume
      Get the disk image associated with the specified Volume object.
      Enter a Volume CIM object, which can be obtained by using the Get-Volume cmdlet.

The Get-DiskImage cmdlet gets the objects associated with one or more disk images (virtual hard disk or ISO). This cmdlet requires either the full image path of the ISO or VHD file, or the device path.

This cmdlet reports whether the specified ISO or VHD file is currently attached.

Standard Aliases for Get-DiskImage: none

Examples

Get a disk image by path:

PS C:\> Get-DiskImage -ImagePath "E:\ISO-Files\palestine.iso"

Get a disk image by device path:

PS C:\> Get-DiskImage -DevicePath \\.\CDROM1

Get the drive letter associated with a mounted ISO:

PS C:\> Get-DiskImage -DevicePath \\.\CDROM1 | Get-Volume

Get the drive letter associated with a mounted VHD:

PS C:\> Get-DiskImage -ImagePath E:\vhd1.vhdx | Get-Disk | Get-Partition | Get-Volume

“Memory is fallible... not because of storage limitations so much as retrieval limitations” ~ Daniel Levitin

Related PowerShell Cmdlets

Mount-DiskImage - Mount a previously created disk image (virtual HD or ISO).
Dismount-DiskImage - Dismount a disk image (virtual hard disk or ISO) so that it can no longer be accessed as a disk.

 


 
Copyright © 1999-2026 SS64.com
Some rights reserved