Remove-WBFileSpec
Remove-WBFileSpec
Removes the list of items to include or exclude from a backup, as specified by the WBFileSpec object, from a backup policy (WBPolicy object).
Syntax
Remove-WBFileSpec [-Policy] <WBPolicy> [-FileSpec] <WBFileSpec> [<CommonParameters>]
Detailed Description
The Remove-WBFileSpec cmdlet removes the list of items to include or exclude from a backup, as specified by the WBFileSpec object, from a backup policy (WBPolicy object).
Parameters
-FileSpec <WBFileSpec>
Specifies the items to remove from the WBPolicy object.
Attributes
Name | Value |
---|---|
Required? |
true |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
true (ByValue) |
Position? |
2 |
-Policy <WBPolicy>
Specifies the backup policy (WBPolicy object) to update.
Attributes
Name | Value |
---|---|
Required? |
true |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
true (ByValue) |
Position? |
1 |
-CommonParameter
This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, and OutVariable. For more information, see about_CommonParameters.
Input and Return Types
The input type is the type of the objects that you can pipe to the cmdlet. The return type is the type of the objects that the cmdlet emits.
Notes
The WBPolicy object must be in edit mode. To put the WBPolicy object in edit mode for a policy that has been set as the scheduled backup policy, use the Get-WBPolicy cmdlet with the -Editable parameter. The New-WBPolicy cmdlet creates a new WBPolicy object already in edit mode.
To use Windows Server Backup cmdlets, you must be a member of the Administrators group or Backup Operators group.
Examples
EXAMPLE 1
C:\PS>$filespeclist = Get-WBFileSpec -Policy $policy
Remove-WBFileSpec -Policy $policy -FileSpec $filespeclist[1]
None
Description
-----------
Removes a specific file spec from the WBPolicy object $policy. This example first gets the cmdlet and then removes the file spec from the policy.