#Autentification et connection au vCenter

$credentialvCenter = Get-Credential administrator@vsphere.local
$vc = Connect-VIServer -Server vcsa.vmware.lab -Credential $credentialvCenter


#Creation du Cluster HA

New-Cluster -Name "PowerCLI-HA" -HARestartPriority High -HAIsolationResponse DoNothing -HAEnabled -Location (Get-Datacenter) -Confirm:$false

# Ajout des Hôtes ESXI

1..3 | % { Move-VMHost ("ESXIP{0:0}.vmware.lab" -f $_) -Location (get-cluster -Name "PowerCLI-HA") }