This command will re-synchronize virtual machines replication, every 10 minutes.

It does not show errors and will stop after all synchronizations are ok

$hyperviseurs = @("SRV-HPV03","SRV-HPV04");$ErrorActionPreference = "SilentlyContinue";while($true){get-vm -ComputerName $hyperviseurs|Resume-VMReplication -Resynchronize;Start-Sleep -Seconds 5;get-vm -ComputerName $hyperviseurs|Reset-VMReplicationStatistics;$repl = get-vm -ComputerName $hyperviseurs|Get-VMReplication|Where-Object Health -notlike "Normal";if($repl.Count -eq 0){exit}else{$resync = $repl|Where-Object State -like "Resynchronizing";$errors = $repl - $resync;Write-Host -NoNewline "In re-synchronize " $resync.Count;Write-Host "";Write-Host -NoNewline "Errors " $errors.Count;Write-Host "";}Start-Sleep -Seconds 600}

Here the explanation :