Add-OBFileSpec

Adds the OBFileSpec object, which specifies the items to include or exclude from a backup, to the backup policy (OBPolicy object).

语法

Default (默认值)

Add-OBFileSpec
    [-Policy] <CBPolicy>
    [-FileSpec] <CBFileSpec[]>
    [-Confirm]
    [-WhatIf]

说明

The Add-OBFileSpec cmdlet adds the OBFileSpec object, which specifies the items to include or exclude from a backup, to the backup policy (OBPolicy object). The OBFileSpec object can include or exclude multiple files, folders, or volumes. The list of items to include can be defined by using the New-OBFileSpec cmdlet and then update the OBPolicy object using this cmdlet. The Add-OBFileSpec cmdlet supports WhatIf and Confirm parameters with a low impact. The low impact signifies that the cmdlet will not prompt the user by default. The WhatIf parameter gives a verbose description of what the cmdlet does. The Confirm parameter specifies whether the cmdlet should prompt the user. Using -Confirm:$FALSE will override the prompt.

To use Microsoft Azure Backup cmdlets, the user needs to be an administrator on the protected machine.

示例

EXAMPLE 1

$policy = Get-OBPolicy



New-OBFileSpec -FileSpec "C:\testdata" -NonRecursive | Add-OBFileSpec -Policy $policy

This example adds a file specification.

EXAMPLE 2

$fspec = New-OBFileSpec -FileSpec C:\testdata -NonRecursive



New-OBPolicy | Add-OBFileSpec -FileSpec $fspec

This example adds a file specification.

参数

-Confirm

Prompts you for confirmation before running the cmdlet.

参数属性

类型:SwitchParameter
默认值:False
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-FileSpec

Specifies the OBFileSpec object to add to the backup policy.

参数属性

类型:

CBFileSpec[]

默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:3
必需:True
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Policy

Specifies the backup policy (OBPolicy object) to update.

参数属性

类型:CBPolicy
默认值:None
支持通配符:False
不显示:False

参数集

(All)
Position:2
必需:True
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

参数属性

类型:SwitchParameter
默认值:False
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

输入

None

输出

Microsoft.Internal.CloudBackup.Commands.OBPolicy