Repair-VM
Repairs one or more virtual machines.
语法
Parameter Set: Default
Repair-VM [-CompatibilityReport] <VMCompatibilityReport> [-Passthru] [-Path <String> ] [-SnapshotFilePath <String> ] [-Confirm] [-WhatIf] [ <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.
参数
-CompatibilityReport<VMCompatibilityReport>
Specifies a compatibility report which includes adjustments to be made during repair.
别名 |
none |
是否必需? |
true |
在哪里? |
1 |
默认值 |
none |
是否接受管道输入? |
True (ByValue) |
是否接受通配符? |
false |
-Passthru
Specifies that an object is to be passed through to the pipeline representing the newly modified compatibility report.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-Path<String>
Specifies the path of the virtual machine to be repaired.
别名 |
none |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-SnapshotFilePath<String>
Specifies the path to be search for virtual machine snapshots.
别名 |
CheckpointFileLocation,SnapshotFileLocation |
是否必需? |
false |
在哪里? |
named |
默认值 |
none |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-Confirm
在运行 cmdlet 前提示你进行确认。
是否必需? |
false |
在哪里? |
named |
默认值 |
false |
是否接受管道输入? |
false |
是否接受通配符? |
false |
-WhatIf
显示在 cmdlet 运行时将发生的情况。该 cmdlet 不运行。
是否必需? |
false |
在哪里? |
named |
默认值 |
false |
是否接受管道输入? |
false |
是否接受通配符? |
false |
<CommonParameters>
此 cmdlet 支持常见的参数:-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer 和 -OutVariable。有关详细信息,请参阅 TechNet 上的 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。
输入
输入类型是可以传送到 cmdlet 的对象的类型。
输出
输出类型是 cmdlet 发出的对象的类型。
- None by default; Microsoft.HyperV.PowerShell.CompatibilityReport if –PassThru is specified.
示例
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