Complete-VMFailover

Completes a virtual machine's failover process on the Replica server. Removes all recovery points on a failed over virtual machine.

Syntax

Complete-VMFailover
        [-ComputerName <String[]>]
        [-VMName] <String[]>
        [-PassThru]
        [-WhatIf]
        [-Confirm]
        [<CommonParameters>]
Complete-VMFailover
        [-PassThru]
        [-VM] <VirtualMachine[]>
        [-WhatIf]
        [-Confirm]
        [<CommonParameters>]

Description

The Complete-VMFailover cmdlet completes a virtual machine's failover process on the Replica server. The recovery point, on which the virtual machine is failed over, is committed and all other recovery points are removed. Failover cannot be canceled after the recovery points are removed.

Examples

Example 1

PS C:\>Complete-VMFailover VM01

This command completes the failover process of a virtual machine named VM01, thereby deleting all other recovery points on the server.

Example 2

PS C:\>Complete-VMFailover *

This command completes the failover process of all virtual machines on the local host for which the failover process has been started.

Parameters

-ComputerName

Specifies one or more Hyper-V hosts on which the failover process is to be completed. NetBIOS names, IP addresses, and fully-qualified domain names are allowable. The default is the local computer - use "localhost" or a dot (".") to specify the local computer explicitly.

Type:String[]
Position:Named
Default value:.
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-PassThru

Specifies that an object is to be passed through to the pipeline representing the virtual machine whose failover process is to be completed.

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

-VM

Specifies the virtual machine whose failover process is to be completed.

Type:VirtualMachine[]
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-VMName

Specifies the name of the virtual machine whose failover process is to be completed.

Type:String[]
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

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

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

Outputs

None by default; Microsoft.HyperV.PowerShell.VirtualMachine if -PassThru is specified.