Edit

Share via


Get-WBVolume

Gets a list of volumes.

Syntax

Disk (Default)

Get-WBVolume
    [-Disk] <WBDisk>
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Policy

Get-WBVolume
    [-Policy] <WBPolicy>
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

CriticalVolumes

Get-WBVolume
    [-CriticalVolumes]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

AllVolumes

Get-WBVolume
    [-AllVolumes]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

VolumePath

Get-WBVolume
    [-VolumePath] <String[]>
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Get-WBVolume cmdlet gets a list of volumes. Use this cmdlet to display volumes included in the WBPolicy object, all critical volumes, all volumes, or volumes in the WBDisk object. You can also use this cmdlet to get a WBVolume object of a volume by using the drive letter of that volume.

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

Examples

Example 1: Get a list of volumes on a disk

PS C:\> $Disks = Get-WBDisk
PS C:\> Get-WBVolume -Disk $Disks[0]

This example gets all volumes present on a disk.

The first command stores the output of the Get-WBDisk cmdlet in the $Disks variable. The command gets a list of all disks on the system.

The second command uses the Get-WBVolume cmdlet to get a list of volumes on the first disk.

Example 2: Get a list of all volumes in the backup policy

PS C:\> $Policy = Get-WBPolicy
PS C:\> Get-WBVolume -Policy $Policy

This example gets a list of all volumes that you added for backup in the WBPolicy object.

The first command stores the result of the Get-WBPolicy cmdlet in a variable named $Policy.

The second command gets the volumes from the $Policy variable.

Example 3: Get volumes for a specific drive letter

PS C:\> Get-WBVolume -VolumePath "E:"

This command gets the WBVolume object for the volume that uses drive letter E:.

Example 4: Get all volumes on a computer

PS C:\> Get-WBVolume -AllVolumes

This command gets a list of WBVolume objects of all the volumes present on the computer.

Example 5: Get all critical volumes on a computer

PS C:\> Get-WBVolume -CriticalVolumes

This command gets the list of all the critical volumes present on the computer. Critical volumes are volumes that contain operating system components and files.

Parameters

-AllVolumes

Indicates that this cmdlet lists all volumes included in the backup policy.

Parameter properties

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

Parameter sets

AllVolumes
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-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

-CriticalVolumes

Indicates that this cmdlet lists only critical volumes, such as volumes that contain operating system files and components.

Parameter properties

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

Parameter sets

CriticalVolumes
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Disk

Specifies a volume that is associated with a certain disk.

Parameter properties

Type:WBDisk
Default value:None
Supports wildcards:False
DontShow:False
Aliases:OnDisk

Parameter sets

Disk
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-Policy

Specifies the policy contained in the WBPolicy object to display.

Parameter properties

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

Parameter sets

Policy
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-VolumePath

Specifies an array of volume drive letters for the volume where you store the backups.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

VolumePath
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
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.WBDisk

Microsoft.Windows.ServerBackup.Commands.WBPolicy

This cmdlet queries the WBPolicy object and the WBDisk object, and it references a string that specifies a path to the volumes where you will store the backups.

Depending on the input parameters, you can use this cmdlet to query the WBPolicy object for a list of volumes specified for backup, query the WBDisk object for a list of volumes present on a particular disk, or get a WBVolume object of the volume that the string specifies VolumePath parameter.

In addition, you can use this cmdlet with the parameters CriticalVolumes and AllVolumes to get the WBVolume list of all critical volumes on the system and all the volumes on the system, respectively.

Outputs

Object

Notes

  • You can add the volumes that you get from this cmdlet to the WBPolicy object by using the Add-WBVolume cmdlet to specify them as volumes to be backed up, or by using the New-WBBackupTarget cmdlet to specify them as backup storage locations.