PoshCode Archive  Artifact [4ecf5a1c19]

Artifact 4ecf5a1c19f3507315672c1cd88588427df1074d9bd03df8f544ceb481e80c86:

  • File reconfigure-ha.ps1 — part of check-in [9e6628af3e] at 2018-06-10 12:56:35 on branch trunk — reconfigure-ha.ps1 – take a VMhost object from the pipeline and apply the ‘Reconfigure HA host’ task (user: Cody Bunch size: 721)

# 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()
}