New-OBFileSpec

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

Syntax

New-OBFileSpec
   [-FileSpec] <String[]>
   [-NonRecursive]
   [-Exclude]

Description

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

Examples

EXAMPLE 1

New-OBFileSpec -FileSpec C:\testdata -NonRecursive

This example creates a new file specification for protection.

Parameters

-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\*.*).

Type:SwitchParameter
Position:4
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-FileSpec

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\*.*).

Type:String[]
Position:2
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-NonRecursive

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

Type:SwitchParameter
Position:3
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

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.