Get-DiskImage

Get-DiskImage

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

構文

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

詳細説明

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.

パラメーター

-AsJob

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-CimSession<CimSession[]>

リモート セッションまたはリモート コンピューターでコマンドレットを実行します。New-CimSession コマンドレットや Get-CimSession コマンドレットの出力など、コンピューター名またはセッション オブジェクトを入力します。既定値は、ローカル コンピューターで実行中の現在のセッションです。

エイリアス

Session

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-DevicePath<String[]>

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

エイリアス

なし

必須?

true

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-ImagePath<String[]>

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

エイリアス

なし

必須?

true

位置は?

1

既定値

なし

パイプライン入力を許可する

True (ByValue, ByPropertyName)

ワイルドカード文字を許可する

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.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByPropertyName)

ワイルドカード文字を許可する

false

-ThrottleLimit<Int32>

このコマンドレットを実行するために確立できる最大同時操作数を指定します。このパラメーターを省略するか、値として 0 を入力した場合、Windows PowerShell® では、コンピューターで実行している CIM コマンドレットの数に基づいて、コマンドレットに対する最適なスロットル制限を計算します。スロットル制限は現在のコマンドレットのみに適用され、セッションまたはコンピューターには適用されません。

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

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.

エイリアス

なし

必須?

false

位置は?

named

既定値

なし

パイプライン入力を許可する

True (ByValue)

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

  • Microsoft.Management.Infrastructure.CimInstance オブジェクトは、Windows Management Instrumentation (WMI) オブジェクトを表示するラッパー クラスです。シャープ記号 (#) の後のパスは、基になる WMI オブジェクトの名前空間とクラス名です。

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

関連トピック

Dismount-DiskImage

Get-Disk

Get-Partition

Get-Volume

Mount-DiskImage