Last active
August 29, 2015 14:13
-
-
Save suusan2go/66289adf0bbf85f3529d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Cl = Get-Cluster | |
$array = New-Object 'System.Collections.Generic.List[System.String]' | |
#fail over hostが持つIDを$arrrayに格納する。 | |
foreach($a in $array) { | |
foreach($fh in $a.ExtensionData.Configuration.DasConfig.AdmissionControlPolicy.Failoverhosts){ | |
$array.add($fh) | |
} | |
} | |
# ESXiホスト名 , HAホスト(true or false)で出力する | |
Get-VmHost | select Name,@{Name="is_fail_over_host";Expression=if($array -contains $_.id){echo $true}else{echo $false}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment