New-WBFileSpec

Windows Server 2012 R2 and Windows 8.1

New-WBFileSpec

Creates a backup file specification.

구문

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




자세한 설명

The New-WBFileSpec cmdlet creates a WBFileSpec object that contains a backup file specification. A WBFileSpec object defines the items the items that a backup includes or excludes. You can add a backup file specification to a WBPolicy object as a source for backup.

You can use this cmdlet to include multiple files, folders, or volumes. Specify volume paths by using volume drive letters, volume mount points, or GUID-based volume names. If you use a GUID-based volume name, ensure that it ends with a backslash (\). You can use wildcard characters (*) in file names to specify a path to a file or to specify a file type to include or exclude.

If you specify a path to exclude from the backup, that path must be part of an inclusion file specification in the policy. Otherwise, the backup ignores the exclusion path.

매개 변수

-Exclude

Indicates that the backup excludes the items in the FileSpec parameter from the backup.


별칭

없음

필수 여부

false

위치

3

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-FileSpec<String[]>

Specifies a list of names of items to include in or exclude from the backup. This parameter can include file paths and volumes (such as "C:\") or file specifications (such as "C:\dir1\*.*").


별칭

없음

필수 여부

true

위치

1

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-NonRecursive

Indicates that the backup includes only the items in the WBFileSpec object and not subordinate items. If you do not include this option, the backup includes items recursively.


별칭

없음

필수 여부

false

위치

2

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

<CommonParameters>

이 cmdlet은 일반 매개 변수 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer 및 -OutVariable을 지원합니다. 자세한 내용은 다음을 참조하세요. about_CommonParameters(http://go.microsoft.com/fwlink/p/?LinkID=113216).

입력

입력 유형은 cmdlet에 파이프할 수 있는 개체의 유형입니다.

  • Spec string, NonRecursive, Excluded flags

    The New-WBFileSpec cmdlet uses Spec, NonRecursive, and Excluded parameters to create a list of items to include or exclude. Spec accepts string objects.


출력

출력 유형은 cmdlet이 내보내는 개체의 유형입니다.

  • WBFileSpec

    The New-WBFileSpec cmdlet displays a WBFileSpec object, which describes a file specification. You can add a WBFileSpec object to a WBPolicy object as a source for backup.


예제

Example 1: Add a file to a backup file specification

This command creates a file specification and adds the file named "C:\Sample\1.jpg" to it.


PS C:\> $Filespec = New-WBFileSpec -FileSpec C:\Sample\1.jpg

Example 2: Add a volume recursively to a backup file specification

This command creates a file specification and adds the contents of the "C:\Sample" folder to it. Because the cmdlet does not include the NonRecursive parameter, the backup includes the contents of this folder and its subfolders.


PS C:\> $Filespec = New-WBFileSpec -FileSpec C:\Sample

Example 3: Add a volume nonrecursively to a backup file specification

This command creates a file specification and adds the contents of the "C:\Sample" folder to it. Because the cmdlet includes the NonRecursive parameter, the backup includes the contents of this folder but not the contents of its subfolders.


PS C:\> $Filespec = New-WBFileSpec -FileSpec C:\Sample -NonRecursive

Example 4: Exclude files from a backup file specification

This command creates an exclusion file specification for MP3 files in the "C:\Sample" folder. The backup excludes MP3 files in "C:\Sample" and its subfolders.


PS C:\> $Filespec = New-WBFileSpec -FileSpec C:\Sample\*.mp3 -Exclude

관련 항목

커뮤니티 추가 항목

추가
표시: