Edit

Share via


Remove-WBVolume

Removes the volume from the backup policy.

Syntax

Default (Default)

Remove-WBVolume
    [-Policy] <WBPolicy>
    [-Volume] <WBVolume>
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Remove-WBVolume cmdlet removes the WBVolume object from the WBPolicy object.

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

Examples

Example 1: Remove a volume from the backup policy

PS C:\> $Policy = Get-WBPolicy
PS C:\> $Volume = Get-WBVolume -VolumePath "E:"
PS C:\> Remove-WBVolume -Policy $Policy -Volume $Volume

This example removes the specified volume from the backup policy. The output is the list of volumes left in the WBPolicy object.

The first command stores the output of Get-WBPolicy in the variable named $Policy.

The second command stores the output of Get-WBVolume in the variable $Volume.

The third command uses Remove-WBVolume to remove the volumes in the variable $Volume from the backup policy object.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Policy

Specifies the WBPolicy object that contains the policy that this cmdlet updates.

Parameter properties

Type:WBPolicy
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Volume

Specifies the volume that this cmdlet removes from the policy contained in the WBPolicy object.

Parameter properties

Type:WBVolume
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.Windows.ServerBackup.Commands.WBPolicy

Microsoft.Windows.ServerBackup.Commands.WBVolume

This cmdlet removes the WBVolume object from the policy contained in the WBPolicy object.

Outputs

Object

Notes

  • The WBPolicy object must be in edit mode. To put the WBPolicy object in edit mode for a policy that you set as the scheduled backup policy, use the Get-WBPolicy cmdlet with the Editable parameter. The New-WBPolicy cmdlet creates a WBPolicy object that is already in edit mode.