Export-VMSnapshot

Export-VMSnapshot

Exports a virtual machine snapshot to disk.

Syntax

Parameter Set: SnapshotName
Export-VMSnapshot [-Name] <String[]> [-Path] <String> -VMName <String[]> [-AsJob] [-ComputerName <String[]> ] [-Passthru] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: SnapshotObject
Export-VMSnapshot [-VMSnapshot] <VMSnapshot[]> [-Path] <String> [-AsJob] [-Passthru] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: VMObject
Export-VMSnapshot [-VM] <VirtualMachine[]> [-Path] <String> -Name <String[]> [-AsJob] [-Passthru] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

The Export-VMSnapshot cmdlet exports a virtual machine snapshot to disk.

Parameters

-AsJob

Specifies that the cmdlet is to be run a background job.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ComputerName<String[]>

Specifies one or more Hyper-V hosts on which the virtual machine snapshot is to be exported. 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

.

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Name<String[]>

Specifies the name of the snapshot to be exported.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Passthru

Specifies that a VMSnapshot object is to be passed through to the pipeline representing the snapshot to be exported.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Path<String>

Specifies the path to the folder into which the snapshot is to be exported.

Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VM<VirtualMachine[]>

Specifies the virtual machine of which the snapshot is to be exported.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-VMName<String[]>

Specifies the name of the virtual machine of which the snapshot is to be exported.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-VMSnapshot<VMSnapshot[]>

Specifies the snapshot to be exported.

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: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

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.

  • None by default; Microsoft.Virtualization.Powershell.Snapshot if –PassThru is specified.

Examples

Example 1

Exports snapshot Base Image of virtual machine TestVM to D:\.

PS C:\> Export-VMSnapshot –Name ‘Base Image’ –VMName TestVM –Path D:\