Checkpoint-VM

Checkpoint-VM

Creates a checkpoint of a virtual machine.

Syntax

Parameter Set: Name
Checkpoint-VM [-Name] <String[]> [[-SnapshotName] <String> ] [-AsJob] [-CimSession <Microsoft.Management.Infrastructure.CimSession[]> ] [-ComputerName <String[]> ] [-Credential <System.Management.Automation.PSCredential[]> ] [-Passthru] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: VMObject
Checkpoint-VM [-VM] <VirtualMachine[]> [[-SnapshotName] <String> ] [-AsJob] [-Passthru] [-Confirm] [-WhatIf] [ <CommonParameters>]




Detailed Description

The Checkpoint-VM cmdlet creates a checkpoint of a virtual machine.

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.

Parameters

-AsJob

Runs the cmdlet as a background job.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

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

Runs 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.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ComputerName<String[]>

Specifies one or more virtual machine hosts on which the virtual machine checkpoint is to be created. 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

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

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

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Name<String[]>

Specifies the name of the virtual machine of which a checkpoint is to be taken.


Aliases

VMName

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Passthru

Specifies that an object is to be passed through to the pipeline representing the virtual machine of which a checkpoint is to be taken.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SnapshotName<String>

Specifies the name of the checkpoint to be taken. If not provided, a combination of the virtual machine’s name and a current timestamp is used.


Aliases

CheckpointName

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VM<VirtualMachine[]>

Specifies the virtual machine of which a checkpoint is to be taken.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.


Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.


Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see    about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Nothing by default; Microsoft.HyperV.PowerShell.Snapshot if -Passthru is specified.


Examples

Example 1

Checkpoints virtual machine Test, creating a checkpoint of it named BeforeInstallingUpdates.


PS C:\> Checkpoint-VM -Name Test -SnapshotName BeforeInstallingUpdates

Example 2

Checkpoints virtual machine Test on Hyper-V host Server1.


PS C:\> Get-VM Test –ComputerName Server1 | Checkpoint-VM

Community Additions

ADD
Show: