Get-WBFileSpec

Gets the list of backup file specifications associated with a backup policy.

Syntax

Get-WBFileSpec
   [-Policy] <WBPolicy>
   [-Confirm]
   [-WhatIf]

Description

The Get-WBFileSpec cmdlet gets the list of WBFileSpec objects that contain backup file specifications for a WBPolicy object that contains a backup policy. A WBFileSpec object defines the items to include in or exclude from backups that you create by using the backup policy.

Use the New-WBFileSpec and Add-WBFileSpec cmdlets to define and apply changes to the backup policy.

To use this cmdlet, you must be a member of the Administrators group or Backup Operators group.

Examples

Example 1: Get backup file specifications for a backup policy

PS C:\> $Filespeclist = Get-WBFileSpec -Policy $Policy

A list of file specs in the WBPolicy object.

This command gets the list of file specifications in the WBPolicy object in the variable named $Policy and assigns them to the $Filespeclist array.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-Policy

Specifies the WBPolicy object that contains the backup policy for which to display backup file specifications.

Type:WBPolicy
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

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

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

Inputs

WBPolicy

The Get-WBFileSpec cmdlet queries the WBPolicy object that contains the specified backup policy.

Outputs

WBFileSpec []

The Get-WBFileSpec cmdlet displays the list of WBFileSpec objects that contain backup file specifications for a WBPolicy object that contains a backup policy.