Get-DiskImage
Get-DiskImage
Gets one or more disk image objects (virtual hard disk or ISO).
Sintaxis
Parameter Set: ByImagePath
Get-DiskImage [-ImagePath] <String[]> [-AsJob] [-CimSession <CimSession[]> ] [-StorageType <StorageType> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Parameter Set: ByDevicePath
Get-DiskImage -DevicePath <String[]> [-AsJob] [-CimSession <CimSession[]> ] [-StorageType <StorageType> ] [-ThrottleLimit <Int32> ] [ <CommonParameters>]
Parameter Set: ByVolume
Get-DiskImage [-AsJob] [-CimSession <CimSession[]> ] [-StorageType <StorageType> ] [-ThrottleLimit <Int32> ] [-Volume <CimInstance> ] [ <CommonParameters>]
Descripción detallada
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.
Parámetros
-AsJob
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-CimSession<CimSession[]>
Ejecuta el cmdlet en una sesión remota o en un equipo remoto. Escriba un nombre de equipo o un objeto de sesión, como la salida de un cmdlet New-CimSession o Get-CimSession. El valor predeterminado es la sesión actual en el equipo local.
Alias |
Session |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-DevicePath<String[]>
Specifies the device path of the ISO or VHD file. You cannot use this parameter with the ImagePath parameter.
Alias |
ninguno |
¿Requerido? |
true |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-ImagePath<String[]>
Specifies the path of the ISO or VHD file. You cannot use this parameter with the DevicePath parameter.
Alias |
ninguno |
¿Requerido? |
true |
¿Posición? |
1 |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByValue, ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-StorageType<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.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByPropertyName) |
¿Aceptar caracteres comodín? |
false |
-ThrottleLimit<Int32>
Especifica el número máximo de operaciones simultáneas que se pueden establecer para ejecutar el cmdlet. Si se omite este parámetro o es especifica un valor de 0
, Windows PowerShell ® calcula un límite óptimo para el cmdlet en función del número de cmdlets de CIM que se estén ejecutando en el equipo. El límite solo se aplica al cmdlet actual, no a la sesión ni al equipo.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-Volume<CimInstance>
Gets the disk image associated with the specified Volume object. Enter a Volume CIM object, which can be obtained by using the Get-Volume cmdlet.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByValue) |
¿Aceptar caracteres comodín? |
false |
<CommonParameters>
Este cmdlet admite los siguientes parámetros comunes: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer y -OutVariable. Para obtener más información, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Entradas
El tipo de entrada es el tipo de los objetos que se pueden canalizar al cmdlet.
Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_Volume
You can pipe a Volume object to the Volume parameter.
Salidas
El tipo de resultado es el tipo de objetos que emite el cmdlet.
Microsoft.Management.Infrastructure.CimInstance#ROOT/Microsoft/Windows/Storage/MSFT_DiskImage
This cmdlet returns an object that represents the specified disk image.
Notas
- El objeto
Microsoft.Management.Infrastructure.CimInstance
es una clase contenedora que muestra objetos de Instrumental de administración de Windows (WMI). La ruta de acceso después del signo de número (#
) proporciona el espacio de nombres y el nombre de clase del objeto WMI subyacente.
Ejemplos
Example 1: Get a disk image by path
This example gets an ISO disk image specified by path and displays information about the disk image.
PS C:\> Get-DiskImage –ImagePath "E:\ISO-Files\My US Visit Fall 2010 Pictures.iso"
Example 2: Get a disk image by device path
This example gets an ISO disk image specified by device path and displays information about the disk image.
PS C:\> Get-DiskImage -DevicePath \\.\CDROM1
Example 3: Get the drive letter associated with a mounted ISO
This example displays the drive letter associated with an ISO file.
PS C:\> Get-DiskImage -DevicePath \\.\CDROM1 | Get-Volume
Example 4: Get the drive letter associated with a mounted VHD
This example displays one or more drive letters associated with volumes in a VHD file.
PS C:\> Get-DiskImage –ImagePath E:\vhd1.vhdx | Get-Disk | Get-Partition | Get-Volume