Get-DiskImage

Get-DiskImage

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

Sintaxe

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>]

Descrição detalhada

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

Aliases

nenhuma

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

-CimSession<CimSession[]>

Executa o cmdlet em uma sessão remota ou em um computador remoto. Insira um nome do computador ou um objeto de sessão, como a saída de um cmdlet New-CimSession ou Get-CimSession. O padrão é a sessão atual do computador local.

Aliases

Session

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

false

-DevicePath<String[]>

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

Aliases

nenhuma

Necessário?

true

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

false

-ImagePath<String[]>

Specifies the path of the ISO or VHD file. You cannot use this parameter with the DevicePath parameter.

Aliases

nenhuma

Necessário?

true

Posição?

1

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByValue, ByPropertyName)

Aceitar caracteres curinga?

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.

Aliases

nenhuma

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByPropertyName)

Aceitar caracteres curinga?

false

-ThrottleLimit<Int32>

Especifica o número máximo de operações simultâneas que podem ser estabelecidas para executar o cmdlet. Se esse parâmetro for omitido ou um valor de 0 for inserido, o Windows PowerShell® calculará o limite ideal de restrição para o cmdlet com base no número de cmdlets do CIM que estão em execução no computador. O limite de restrição se aplica somente ao cmdlet atual, e não à sessão ou ao computador.

Aliases

nenhuma

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

false

Aceitar caracteres curinga?

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.

Aliases

nenhuma

Necessário?

false

Posição?

named

Valor padrão

nenhuma

Aceitar entrada do pipeline?

True (ByValue)

Aceitar caracteres curinga?

false

<CommonParameters>

Esse cmdlet dá suporte a parâmetros comuns: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer e -OutVariable. Para obter mais informações, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Entradas

O tipo de entrada é o tipo dos objetos que você pode canalizar para o cmdlet.

Saídas

O tipo de saída é o tipo de objeto emitido pelo cmdlet.

Observações

  • O objeto Microsoft.Management.Infrastructure.CimInstance é uma classe wrapper que exibe objetos da WMI (Instrumentação de Gerenciamento do Windows). O caminho após o sinal de cerquilha (#) indica o namespace e o nome de classe do objeto subjacente da WMI.

Exemplos

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

Tópicos relacionados

Dismount-DiskImage

Get-Disk

Get-Partition

Get-Volume

Mount-DiskImage