Repair-VM
Repairs one or more virtual machines.
Repair-VM
[-CompatibilityReport] <VMCompatibilityReport>
[-SnapshotFilePath <String>]
[-Path <String>]
[-Passthru]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
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.
PS C:\> Repair-VM -CompatibilityReport $VMCompatReport -Path C:\Test
This example changes the configuration path for a virtual machine compatibility report.
PS C:\> Repair-VM -CompatibilityReport $VMCompatReport -SnapshotFilePath C:\Snapshots
This example adds missing snapshots to a virtual machine compatibility report.
Specifies a compatibility report which includes adjustments to be made during repair.
Type: | VMCompatibilityReport |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
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 |
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 |
Specifies the path to be search for virtual machine snapshots.
Type: | String |
Aliases: | CheckpointFileLocation, SnapshotFileLocation |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
None
Default
Microsoft.HyperV.PowerShell.CompatibilityReport
If -PassThru is specified.