New-OBFileSpec

New-OBFileSpec

Creates a new OBFileSpec object based on the parameters that are specified.

语法

Parameter Set: Default
New-OBFileSpec [-FileSpec] <String[]> [[-NonRecursive]] [[-Exclude]] [ <CommonParameters>]

详细说明

The New-OBFileSpec cmdlet creates a new OBFileSpec object based on the parameters that are specified. The OBFileSpec object defines what items will be included or excluded from backups.

Multiple files, folders, or volumes can be included or excluded. Volume paths can be specified using volume drive letters, volume mount points, or GUID-based volume names. If a GUID-based volume name is specified, it should be terminated with a backslash (\). The wildcard character (*) can be used in the file name when specifying a path to a file or when specifying a file type to include or exclude.

The items in the OBFileSpec object can be specified to be either recursive (include the item and everything subordinate to the item in the file structure) or non-recursive (include only the item).

参数

-Exclude

Specifies the list of items that are to excluded from the OBFileSpec object. This parameter can include file paths and volumes (such as C:) or file specifications (such as C:\dir1\*.*).

别名

none

是否必需?

false

在哪里?

4

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

-FileSpec<String[]>

Specifies the list of items for the OBFileSpec object. This parameter can include file paths and volumes (such as C:) or file specifications (such as C:\dir1\*.*).

别名

none

是否必需?

true

在哪里?

2

默认值

none

是否接受管道输入?

True (ByValue)

是否接受通配符?

false

-NonRecursive

Specifies that the items in the OBFileSpec object should be non-recursive, and only include the specified items.

别名

none

是否必需?

false

在哪里?

3

默认值

none

是否接受管道输入?

false

是否接受通配符?

false

<CommonParameters>

此 cmdlet 支持常见的参数:-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer 和 -OutVariable。有关详细信息,请参阅 TechNet 上的 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

输入

输入类型是可以传送到 cmdlet 的对象的类型。

  • None

输出

输出类型是 cmdlet 发出的对象的类型。

  • Microsoft.Internal.CloudBackup.Commands.OBFileSpec

    This cmdlet displays the OBFileSpec object which describes a file specification. This can be added to the OBPolicy object as a source for backup.

示例

EXAMPLE 1

This example creates a new file specification for protection.

PS C:\> New-OBFileSpec -FileSpec C:\testdata –NonRecursive

相关主题

Add-OBFileSpec

Get-OBFileSpec

Get-OBPolicy

New-OBRetentionPolicy

New-OBSchedule

Remove-OBFileSpec

Remove-OBPolicy

Set-OBPolicy

Set-OBRetentionPolicy

Set-OBSchedule