Repair-VM

Repair-VM

Repairs one or more virtual machines.

Syntax

Parameter Set: Default
Repair-VM [-CompatibilityReport] <VMCompatibilityReport> [-Passthru] [-Path <String> ] [-SnapshotFilePath <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detaillierte Beschreibung

The Repair-VM cmdlet corrects some issues that can impact the ability to import or move a virtual machine. If Compare-VM determines that an import or move operation would fail for a particular VM, it returns a collection of incompatibilities that need to be fixed before the operation can succeed. Most of these incompatibilities can be fixed by using Set-VM. However, Set-VM does not modify either the path where the VM configuration is stored or the path where the snapshot files are stored. Repair-VM handles these two particular issues in this one specific situation.

Parameter

-CompatibilityReport<VMCompatibilityReport>

Specifies a compatibility report which includes adjustments to be made during repair.

Aliase

none

Erforderlich?

true

Position?

1

Standardwert

none

Pipelineeingaben akzeptieren?

True (ByValue)

Platzhalterzeichen akzeptieren?

false

-Passthru

Specifies that an object is to be passed through to the pipeline representing the newly modified compatibility report.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-Path<String>

Specifies the path of the virtual machine to be repaired.

Aliase

none

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

Platzhalterzeichen akzeptieren?

false

-SnapshotFilePath<String>

Specifies the path to be search for virtual machine snapshots.

Aliase

CheckpointFileLocation,SnapshotFileLocation

Erforderlich?

false

Position?

named

Standardwert

none

Pipelineeingaben akzeptieren?

false

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.

Ausgaben

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

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

Beispiele

Example 1

This example changes the configuration path for a virtual machine compatibility report.

PS C:\> Repair-VM –CompatibilityReport $VMCompatReport –Path C:\Test

Example 2

This example adds missing snapshots to a virtual machine compatibility report.

PS C:\> Repair-VM –CompatibilityReport $VMCompatReport –SnapshotFilePath C:\Snapshots