Get-WBFileSpec

Get-WBFileSpec

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

Syntax

Parameter Set: Default
Get-WBFileSpec [-Policy] <WBPolicy> [-Confirm] [-WhatIf] [ <CommonParameters>]

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

Parameters

-Policy<WBPolicy>

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

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before running the cmdlet.

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

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

Required?

false

Position?

named

Default Value

false

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • WBPolicy

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

Outputs

The output type is the type of the objects that the cmdlet emits.

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

Examples

Example 1: Get backup file specifications for a backup policy

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

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

A list of file specs in the WBPolicy object.

Add-WBFileSpec

Get-WBFileSpec

New-WBPolicy

Remove-WBFileSpec