Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

Repair-VM

Windows Server 2012 R2 and Windows 8.1

Updated: March 3, 2014

Applies To: Windows 8.1, Windows PowerShell 4.0, Windows Server 2012 R2

Repair-VM

Repairs one or more virtual machines.

Syntax

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




Detailed Description

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.

Parameters

-CompatibilityReport<VMCompatibilityReport>

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


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-ComputerName<String[]>

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

-Passthru

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


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Path<String>

Specifies the path of the virtual machine to be repaired.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-SnapshotFilePath<String>

Specifies the path to be search for virtual machine snapshots.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

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.

Inputs

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

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


Outputs

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

Examples

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

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.