Merge-VHD

Merge-VHD

Merges virtual hard disks.

Syntax

Parameter Set: Default
Merge-VHD [-Path] <String> [[-DestinationPath] <String> ] [-AsJob] [-CimSession <Microsoft.Management.Infrastructure.CimSession[]> ] [-ComputerName <String[]> ] [-Credential <System.Management.Automation.PSCredential[]> ] [-Force] [-Passthru] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detaillierte Beschreibung

The Merge-VHD cmdlet merges virtual hard disks in a differencing virtual hard disk chain. The merge is from a specified source child disk to a specified destination child disk.

Merge is an offline operation; the virtual hard disk chain must not be attached when merge is initiated.

Parameter

-AsJob

Runs the cmdlet as a background job.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

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

Das Cmdlet wird in einer Remotesitzung oder auf einem Remotecomputer ausgeführt. Geben Sie einen Computernamen oder ein Sitzungsobjekt ein, wie z. B. die Ausgabe eines New-CimSession oder Get-CimSession-Cmdlets. Der Standardwert ist die aktuelle Sitzung auf dem lokalen Computer.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-ComputerName<String[]>

Specifies one or more Hyper-V hosts on which virtual hard disks are to be merged. 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.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

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.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-DestinationPath<String>

Specifies the path to the child in the virtual hard disk chain that is the destination for the merge command.

Aliase

none

Erforderlich?

false

Position?

2

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Force

Runs the cmdlet without prompting for confirmation.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Passthru

Specifies that an object is to be passed through to the pipeline representing the merged virtual hard disk.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Path<String>

Specifies the path to the child in the virtual hard disk chain that is the source for the merge command. If a filename or relative path is specified, the virtual hard disk path will be calculated relative to the current working directory.

Aliase

FullName

Erforderlich?

true

Position?

1

Standardwert

none

Pipelineeingaben akzeptieren?

true (ByValue, ByPropertyName)

Platzhalterzeichen akzeptieren?

false

-Confirm

Fordert Sie vor der Ausführung des Cmdlet zum Bestätigen auf.

Erforderlich?

false

Position?

named

Standardwert

false

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-WhatIf

Zeit, was passieren würde, wenn das Cmdlet ausgeführt wird. Das Cmdlet wird nicht ausgeführt.

Erforderlich?

false

Position?

named

Standardwert

false

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

<CommonParameters>

Dieses Cmdlet unterstützt die allgemeinen Parameter: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer und -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 Sie per Piping an das Cmdlet übergeben können.

  • VHDObject

Ausgaben

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

Beispiele

Example 1

This example merges the virtual hard disk from Child4 to Child2, for a virtual disk chain with Child4 as a child of Child3, Child3 as a child of Child2, Child2 as a child of Child1, and Child1 as a child of Parent, and with the virtual hard disk file for each located in c:\test. This example merges all data from Child4 and Child3 up to Child2. Child4.vhdx and Child3.vhdx are not deleted, but are no longer valid virtual hard disk files after the operation.

PS C:\> Merge-VHD –Path c:\test\Child4.vhdx –DestinationPath c:\test\Child2.vhdx