Remove-WBVirtualMachine

Removes the list of virtual machines from the backup policy.

Syntax

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

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-WBVirtualMachines $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 in the $Policy variable.

Required Parameters

-Policy

Specifies the WBPolicy object that contains the backup policy to update.

Type:WBPolicy
Position:1
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Optional Parameters

-All

Indicates whether to remove all virtual machines from the backup contained in the WBPolicy object.

Type:SwitchParameter
Position:2
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-VirtualMachine

Specifies an array of one or more virtual machines to be removed from the backup policy contained in the WBPolicy object.

Type:WBVirtualMachine[]
Position:2
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False
-WhatIf

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

Type:SwitchParameter
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

Windows.ServerBackup.Commands.WBPolicy

Outputs

Windows.ServerBackup.Commands.WBVirtualMachine[]