Export-VM

Export-VM

Exports a virtual machine to disk.

Syntax

Parameter Set: Name
Export-VM [-Name] <String[]> [-Path] <String> [-AsJob] [-ComputerName <String[]> ] [-Passthru] [ <CommonParameters>]

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

Detaillierte Beschreibung

The Export-VM cmdlet exports a virtual machine to disk. This cmdlet creates a folder at a specified location having three subfolders: Snapshots, Virtual Hard Disks, and Virtual Machines. The Snapshots and Virtual Hard Disks folders contain the snapshots of and virtual hard disks of the specified virtual machine respectively. The Virtual Machines folder contains the configuration XML of the specified virtual machine.

Parameter

-AsJob

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

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-ComputerName<String[]>

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

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

.

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Name<String[]>

Specifies the name of the virtual machine to be exported.

Aliasse

Keiner

Erforderlich?

true

Position?

1

Standardwert

Keiner

Pipelineeingaben akzeptieren?

true (ByValue)

Platzhalterzeichen akzeptieren?

true

-Passthru

Specifies that a Microsoft.HyperV.PowerShell.VirtualMachine object is to be passed through to the pipeline representing the virtual machine to be exported.

Aliasse

Keiner

Erforderlich?

false

Position?

named

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Path<String>

Specifies the path to the folder into which the virtual machine is to be exported.

Aliasse

Keiner

Erforderlich?

true

Position?

2

Standardwert

Keiner

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

true

-VM<VirtualMachine[]>

Specifies the virtual machine to be exported.

Aliasse

Keiner

Erforderlich?

true

Position?

1

Standardwert

Keiner

Pipelineeingaben akzeptieren?

true (ByValue)

Platzhalterzeichen akzeptieren?

false

<CommonParameters>

Dieses Cmdlet unterstützt die allgemeinen Parameter: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, -OutVariable. Weitere Informationen finden Sie unter about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Eingaben

Der Eingabetyp ist der Typ der Objekte, die über die Pipeline an das Cmdlet übergeben werden können.

Ausgaben

Der Ausgabetyp ist der Typ der Objekte, die vom Cmdlet ausgegeben werden.

  • None by default; Microsoft.HyperV.PowerShell.VirtualMachine if –PassThru is specified.

Beispiele

Example 1

Exports virtual machine Test to the root of the D drive.

PS C:\> Export-VM –Name Test –Path D:\

Example 2

Exports all virtual machines to the root of the D drive. Each virtual machine will be exported to its own folder.

PS C:\> Get-VM | Export-VM –Path D:\