New-VBRSelectedFilesWildcardMask

Short Description

Defines a file mask for the backup scope of Veeam Agent backup jobs.

Product Edition: Community, Standard, Enterprise, Enterprise Plus, Veeam Universal License

Syntax

New-VBRSelectedFilesWildcardMask -Wildcard <String> [<CommonParameters>]

Detailed Description

This cmdlet creates the VBRSelectedFilesWildcardMask object. This object defines a file mask that you can use to include files in the backup scope of a Veeam Agent backup job or to exclude them from it.

The mask applies only to file names and extensions, for example *.log. It does not accept paths.

To apply the mask, set it as the InclusionMask or ExclusionMask parameter value of the New-VBRSelectedFilesBackupOptionsDefines backup scope settings for Veeam Agent backup jobs. or Set-VBRSelectedFilesBackupOptionsModifies the backup scope settings for Veeam Agent backup jobs. cmdlet.

Note: If the backup scope of a job that backs up a Windows computer includes an entire volume, Veeam Agent for Microsoft Windows backs up this volume at the volume level and does not apply file masks to it.

Parameters

Parameters

Parameter

Description

Type

Required

Position

Accept Pipeline Input

Wildcard

Specifies the file mask, for example *.log or ?ackup.tmp.

The mask applies only to file names and extensions, not to folder names. To exclude a folder, use a path mask. Do not specify a path or use the ** recursive pattern.

On Linux, macOS and Unix computers, the *.* mask matches only the names that contain a dot, and masks follow the case sensitivity of the file system. On Windows computers, masks are case-insensitive.

String

True

Named

True (ByPropertyName, ByValue)

<CommonParameters>

This cmdlet supports Microsoft PowerShell common parameters. For more information on common parameters, see Microsoft Docs.

Output Object

The cmdlet returns the VBRSelectedFilesWildcardMask object that defines a file mask for the backup scope.

Examples

New-VBRSelectedFilesWildcardMaskExample 1. Excluding Files from Backup Scope Using File Mask (Windows)

This example shows how to exclude all files of the TMP format from the backup scope of a Veeam Agent backup job that backs up a Windows computer.

$mask = New-VBRSelectedFilesWildcardMask -Wildcard "*.tmp"

New-VBRSelectedFilesBackupOptions -OSPlatform Windows -BackupSelectedFiles -SelectedFiles "C:\Data" -ExclusionMask $mask

Perform the following steps:

  1. Run the New-VBRSelectedFilesWildcardMask cmdlet. Specify the Wildcard parameter value. Save the result to the $mask variable.
  2. Run the New-VBRSelectedFilesBackupOptionsDefines backup scope settings for Veeam Agent backup jobs. cmdlet. Specify the following settings:
    • Set the Windows value for the OSPlatform parameter.
    • Provide the BackupSelectedFiles parameter.
    • Specify the SelectedFiles parameter value.
    • Set the $mask variable as the ExclusionMask parameter value.

New-VBRSelectedFilesWildcardMaskExample 2. Including Files in Backup Scope Using File Mask (Linux)

This example shows how to back up only the PDF files from the /home/user01 directory on a Linux computer.

$mask = New-VBRSelectedFilesWildcardMask -Wildcard "*.pdf"

New-VBRSelectedFilesBackupOptions -OSPlatform Linux -BackupSelectedFiles -SelectedFiles "/home/user01" -InclusionMask $mask

Perform the following steps:

  1. Run the New-VBRSelectedFilesWildcardMask cmdlet. Specify the Wildcard parameter value. Save the result to the $mask variable.
  2. Run the New-VBRSelectedFilesBackupOptionsDefines backup scope settings for Veeam Agent backup jobs. cmdlet. Specify the following settings:
    • Set the Linux value for the OSPlatform parameter.
    • Provide the BackupSelectedFiles parameter.
    • Specify the SelectedFiles parameter value.
    • Set the $mask variable as the InclusionMask parameter value.

Page updated 2026-11-17

Page content applies to build 13.2.0.193