Add-WBVirtualMachine
Add-WBVirtualMachine
Adds a list of virtual machines to the backup policy.
Sintaxis
Parameter Set: All
Add-WBVirtualMachine [-Policy] <WBPolicy> [[-All]] [-Confirm] [-WhatIf] [ <CommonParameters>]
Parameter Set: WBVirtualMachine
Add-WBVirtualMachine [-Policy] <WBPolicy> [[-VirtualMachine] <WBVirtualMachine[]> ] [-Confirm] [-WhatIf] [ <CommonParameters>]
Descripción detallada
The Add-WBVirtualMachine cmdlet adds a list of virtual machines to a backup policy contained in the specified WBPolicy object.
Parámetros
-All
Indicates that all virtual machines on the computer are added to the policy.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
2 |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-Policy<WBPolicy>
Specifies a WBPolicy object that contains the backup policy to update.
Alias |
ninguno |
¿Requerido? |
true |
¿Posición? |
1 |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-VirtualMachine<WBVirtualMachine[]>
Specifies an array of one or more virtual machines to add to the WBPolicy object.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
2 |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByValue) |
¿Aceptar caracteres comodín? |
false |
-Confirm
Solicita confirmación antes de ejecutar el cmdlet.
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
falso |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-WhatIf
Muestra lo que sucedería si se ejecutara el cmdlet. El cmdlet no se ejecuta.
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
falso |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
<CommonParameters>
Este cmdlet admite los siguientes parámetros comunes: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer y -OutVariable. Para obtener más información, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Entradas
El tipo de entrada es el tipo de los objetos que se pueden canalizar al cmdlet.
Salidas
El tipo de resultado es el tipo de objetos que emite el cmdlet.
Ejemplos
Example 1: Add virtual machines to the backup policy
This example adds the list of volumes in the $VirtualMachines variable to the WBPolicy object $Policy.
The first command stores the result of the Get-WBPolicy cmdlet in the $Policy variable.
The second command stores the result of the Get-WBVirtualMachine cmdlet in the $VirtualMachines variable.
The third command adds the virtual machines listed in the $VirtualMachines variable to the backup policy in the $Policy variable.
PS C:\> $Policy = Get-WBPolicy
PS C:\> $VirtualMachines = Get-WBVirtualMachine
PS C:\> Add-WBVirtualMachine -Policy $Policy -VirtualMachine $VirtualMachines