Get-VMSnapshot

Get-VMSnapshot

Gets the checkpoints associated with a virtual machine or checkpoint.

構文

Parameter Set: Child
Get-VMSnapshot [[-Name] <String> ] -ChildOf <VMSnapshot> [-SnapshotType <SnapshotType> {Standard | Recovery | Planned | Missing | Replica | AppConsistentReplica | SyncedReplica} ] [ <CommonParameters>]

Parameter Set: Id
Get-VMSnapshot [-Id] <Guid]> [-CimSession <Microsoft.Management.Infrastructure.CimSession[]> ] [-ComputerName <String[]> ] [-Credential <System.Management.Automation.PSCredential[]> ] [ <CommonParameters>]

Parameter Set: Parent
Get-VMSnapshot [[-Name] <String> ] -ParentOf <VirtualMachineBase> [-SnapshotType <SnapshotType> {Standard | Recovery | Planned | Missing | Replica | AppConsistentReplica | SyncedReplica} ] [ <CommonParameters>]

Parameter Set: VMName
Get-VMSnapshot [-VMName] <String[]> [[-Name] <String> ] [-CimSession <Microsoft.Management.Infrastructure.CimSession[]> ] [-ComputerName <String[]> ] [-Credential <System.Management.Automation.PSCredential[]> ] [-SnapshotType <SnapshotType> {Standard | Recovery | Planned | Missing | Replica | AppConsistentReplica | SyncedReplica} ] [ <CommonParameters>]

Parameter Set: VMObject
Get-VMSnapshot [-VM] <VirtualMachine[]> [[-Name] <String> ] [-SnapshotType <SnapshotType> {Standard | Recovery | Planned | Missing | Replica | AppConsistentReplica | SyncedReplica} ] [ <CommonParameters>]

詳細説明

The Get-VMSnapshot cmdlet gets the checkpoints associated with a virtual machine or checkpoint.

Note: In Windows Server 2012 R2, virtual machine snapshots were renamed to virtual machine checkpoints. For clarity, this document will refer to virtual machine snapshots as checkpoints.

パラメーター

-ChildOf<VMSnapshot>

Specifies the checkpoint whose child checkpoints are to be retrieved. This retrieves immediate children only.

Aliases

none

必須/オプション

true

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-CimSession<Microsoft.Management.Infrastructure.CimSession[]>

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

Aliases

none

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-ComputerName<String[]>

Specifies one or more Hyper-V hosts on which checkpoints are to be retrieved. NetBIOS names, IP addresses, and fully qualified domain names are allowable. The default is the local computer. Use localhost or a dot (.) to specify the local computer explicitly.

Aliases

none

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-Credential<System.Management.Automation.PSCredential[]>

Specifies one or more user accounts that have permission to perform this action. The default is the current user.

Aliases

none

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-Id<Guid]>

Specifies the unique identifier of the virtual machine whose checkpoints are to be retrieved.

Aliases

none

必須/オプション

true

位置

1

既定値

none

パイプライン入力の受け入れ

True (ByValue, ByPropertyName)

ワイルドカード文字の受け入れ

false

-Name<String>

Specifies the name of the checkpoint to be retrieved.

Aliases

none

必須/オプション

false

位置

2

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-ParentOf<VirtualMachineBase>

Specifies the checkpoint whose immediate parent checkpoint is to be retrieved.

Aliases

none

必須/オプション

true

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-SnapshotType<SnapshotType>

Specifies the type of the checkpoints to be retrieved. Allowed values are Standard, Recovery, Planned, Missing, Replica, AppConsistentReplica, and SyncedReplica.

Aliases

VMRecoveryCheckpoint

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-VM<VirtualMachine[]>

Specifies the virtual machine whose checkpoints are to be retrieved.

Aliases

none

必須/オプション

true

位置

1

既定値

none

パイプライン入力の受け入れ

True (ByValue)

ワイルドカード文字の受け入れ

false

-VMName<String[]>

Specifies the name of the virtual machine whose checkpoints are to be retrieved.

Aliases

none

必須/オプション

true

位置

1

既定値

none

パイプライン入力の受け入れ

True (ByValue)

ワイルドカード文字の受け入れ

false

<CommonParameters>

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

入力

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

出力

出力型は、コマンドレットが出力するオブジェクトの型です。

  • Microsoft.HyperV.PowerShell.Snapshot

使用例

Example 1

Gets all checkpoints of virtual machine TestVM.

PS C:\> Get-VMSnapshot –VMName TestVM

Example 2

Gets all standard checkpoints of virtual machine TestVM.

PS C:\> Get-VM –Name TestVM | Get-VMSnapshot –SnapshotType Standard

Example 3

Gets the immediate parent of checkpoint Before applying updates of virtual machine TestVM.

PS C:\> $snapshot = Get-VMSnapshot –Name 'Before applying updates' –VMName TestVM
PS C:\> Get-VMSnapshot –ParentOf $snapshot

Example 4

Gets the immediate child checkpoints of checkpoint Before applying updates of virtual machine TestVM.

PS C:\> $snapshot = Get-VMSnapshot –Name 'Before applying updates' –VMName TestVM
PS C:\> Get-VMSnapshot –ChildOf $snapshot