Remove-WBFileSpec

Remove-WBFileSpec

Removes a backup file specification from a backup policy.

構文

Parameter Set: Default
Remove-WBFileSpec [-Policy] <WBPolicy> [-FileSpec] <WBFileSpec> [-Confirm] [-WhatIf] [ <CommonParameters>]

詳細説明

The Remove-WBFileSpec cmdlet removes a WBFileSpec object that contains a backup file specification from a WBPolicy object that contains a backup policy. A backup file specification contains a list of items to include in or exclude from backups that use the backup policy.

Before you can remove a backup file specification from a WBPolicy object, you must put the WBPolicy object in edit mode. To put the WBPolicy object in edit mode for a policy that you set as the scheduled backup policy, use the Get-WBPolicy cmdlet with the -Editable parameter. The New-WBPolicy cmdlet creates a new WBPolicy object that is already in edit mode.

To use this cmdlet, you must be a member of the Administrators group or Backup Operators group.

パラメーター

-FileSpec<WBFileSpec>

Specifies a backup file specification object to remove from the WBPolicy object.

エイリアス

なし

必須?

true

位置は?

2

既定値

なし

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

True (ByValue)

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

false

-Policy<WBPolicy>

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

エイリアス

なし

必須?

true

位置は?

1

既定値

なし

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

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)。

入力

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

  • WBFileSpec, WBPolicy

    The Remove-WBFileSpec cmdlet removes a WBFileSpec object from a WBPolicy object.

出力

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

  • None

    None

Example 1: Remove a backup file specification from a backup policy

This example removes a backup file specification from a backup policy.

The first command gets a list of the backup file specifications from the backup policy in the variable named $Policy. The command assigns the backup file specifications to the array in the variable named $Filespeclist.

The second command removes the backup file specification in the first element of $Filespeclist from the policy in $Policy.

PS C:\> $Filespeclist = Get-WBFileSpec -Policy $policy
PS C:\> Remove-WBFileSpec -Policy $policy -FileSpec $Filespeclist[1]

関連トピック

Get-WBFileSpec

Get-WBPolicy