Edit

Share via


Remove-WBVirtualMachine

Removes the list of virtual machines from the backup policy.

Syntax

WBVirtualMachine

Remove-WBVirtualMachine
    [-Policy] <WBPolicy>
    [[-VirtualMachine] <WBVirtualMachine[]>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

All

Remove-WBVirtualMachine
    [-Policy] <WBPolicy>
    [-All]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Remove-WBVirtualMachine cmdlet removes the list of virtual machines from the backup policy contained in the WBPolicy object.

Examples

Example 1: Remove virtual machines from the backup policy

PS C:\> $Policy = Get-WBPolicy
PS C:\> Remove-WBVirtualMachine $Policy -All

This example removes all virtual machines from the backup policy.

The first command calls the Get-WBPolicy cmdlet and assigns the result to the $Policy variable.

The second command removes the virtual machines from the backup policy stored in the $Policy variable.

Parameters

-All

Indicates that this cmdlet removes all virtual machines from the backup contained in the WBPolicy object.

Parameter properties

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

Parameter sets

All
Position:1
Mandatory:False
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

-Policy

Specifies the WBPolicy object that contains the backup 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:False
Value from remaining arguments:False

-VirtualMachine

Specifies an array of one or more virtual machines that this cmdlet removes from the backup policy contained in the WBPolicy object.

Parameter properties

Type:

WBVirtualMachine[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

WBVirtualMachine
Position:1
Mandatory:False
Value from pipeline:True
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.WBVirtualMachine

Outputs

Object