Repair-VM

Repairs one or more virtual machines.

Syntax

Repair-VM
      [-CompatibilityReport] <VMCompatibilityReport>
      [-ComputerName <String[]>]
      [-Passthru]
      [-Path <String>]
      [-SnapshotFilePath <String>]
      [-Confirm]
      [-WhatIf]

Description

The Repair-VM cmdlet repairs one or more virtual machines.

Examples

Example 1

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

Changes the configuration path for a virtual machine compatibility report.

Example 2

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

Adds missing snapshots to a virtual machine compatibility report.

Parameters

-CompatibilityReport

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

Type:VMCompatibilityReport
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ComputerName

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.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Position:Named
Default value:False
Required:False
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.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Path

Specifies the path of the virtual machine to be repaired.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SnapshotFilePath

Specifies the path to be search for virtual machine snapshots.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Default

Microsoft.Virtualization.Powershell.CompatibilityReport

If -PassThru is specified.