Add-WBVirtualMachine

Add-WBVirtualMachine

Adds a list of virtual machines to the backup policy.

構文

Parameter Set: All
Add-WBVirtualMachine [-Policy] <WBPolicy> [[-All]] [-Confirm] [-WhatIf] [ <CommonParameters>]

Parameter Set: WBVirtualMachine
Add-WBVirtualMachine [-Policy] <WBPolicy> [[-VirtualMachine] <WBVirtualMachine[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

詳細説明

The Add-WBVirtualMachine cmdlet adds a list of virtual machines to a backup policy contained in the specified WBPolicy object.

パラメーター

-All

Indicates that all virtual machines on the computer are added to the policy.

エイリアス

なし

必須?

false

位置は?

2

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Policy<WBPolicy>

Specifies a WBPolicy object that contains the backup policy to update.

エイリアス

なし

必須?

true

位置は?

1

既定値

なし

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-VirtualMachine<WBVirtualMachine[]>

Specifies an array of one or more virtual machines to add to the WBPolicy object.

エイリアス

なし

必須?

false

位置は?

2

既定値

なし

パイプライン入力を許可する

True (ByValue)

ワイルドカード文字を許可する

false

-Confirm

コマンドレットを実行する前に、ユーザーに確認を求めます。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-WhatIf

コマンドレットを実行するとどのような結果になるかを表示します。コマンドレットは実行されません。

必須?

false

位置は?

named

既定値

false

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

<CommonParameters>

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

入力

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

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

Example 1: Add virtual machines to the backup policy

This example adds the list of volumes in the $VirtualMachines variable to the WBPolicy object $Policy.

The first command stores the result of the Get-WBPolicy cmdlet in the $Policy variable.

The second command stores the result of the Get-WBVirtualMachine cmdlet in the $VirtualMachines variable.

The third command adds the virtual machines listed in the $VirtualMachines variable to the backup policy in the $Policy variable.

PS C:\> $Policy = Get-WBPolicy
PS C:\> $VirtualMachines = Get-WBVirtualMachine
PS C:\> Add-WBVirtualMachine -Policy $Policy -VirtualMachine $VirtualMachines

関連トピック

Get-WBVirtualMachine

Remove-WBVirtualMachine