Repair-VM

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.

Aliases

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.

Aliases

none

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-Path<String>

Specifies the path of the virtual machine to be repaired.

Aliases

none

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-SnapshotFilePath<String>

Specifies the path to be search for virtual machine snapshots.

Aliases

CheckpointFileLocation,SnapshotFileLocation

必須/オプション

false

位置

named

既定値

none

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-Confirm

コマンドレットを実行する前に確認メッセージを表示します。

必須/オプション

false

位置

named

既定値

false

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

-WhatIf

コマンドレットが実行された場合に何が起きるのかを示します。コマンドレットは実行されません。

必須/オプション

false

位置

named

既定値

false

パイプライン入力の受け入れ

false

ワイルドカード文字の受け入れ

false

<CommonParameters>

このコマンドレットは共通のパラメーターをサポートしています(-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、および -OutVariable)。詳細については、TechNet の「 「about_CommonParameters」 (https://go.microsoft.com/fwlink/p/?LinkID=113216) を参照してください。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

出力

出力型は、コマンドレットが出力するオブジェクトの型です。

  • 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