# encoding: ascii
# api: powershell
# title: reconfigure-ha.ps1
# description: reconfigure-ha.ps1	 – take a VMhost object from the pipeline and apply the ‘Reconfigure HA host’ task
# version: 0.1
# author: Cody Bunch
# license: CC0
# x-poshcode-id: 1169
# x-archived: 2014-10-10T07:40:11
# x-published: 2009-06-23T07:30:00
#
#
#ThePowerShellTalk
#reconfigure-ha.ps1
#take a VMhost object from the pipeline and apply the 'Reconfigure HA host' task

Process {
    if ( $_ -isnot [VMware.VimAutomation.Client20.VMHostImpl] ) {
        Write-Error "VMHost expected, skipping object in pipeline."
        continue
    }
	$vmhostView = $_ | Get-View
    $vmhostView.ReconfigureHostForDAS_Task()
}
