Repair-VM
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 repairs one or more virtual machines.
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 (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
- None by default; Microsoft.Virtualization.Powershell.CompatibilityReport if –PassThru is specified.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
Example 1
Changes the configuration path for a virtual machine compatibility report.
PS C:\> Repair-VM –CompatibilityReport $VMCompatReport –Path C:\Test
Example 2
Adds missing snapshots to a virtual machine compatibility report.
PS C:\> Repair-VM –CompatibilityReport $VMCompatReport –SnapshotFilePath C:\Snapshots