Hi NG,
I’m stuck currently with this simple task but I don’t understand what all the articles want to explain me.
I’m collecting a bunch of XenServer pool master IP addresses from XenDesktop. Then I want to loop through each of the IP addresses to get the corresponding hypervisorconnectionname. Sometime there can be more than 1 hypervisorconnectionnames for an IP address.
My issue is that the hash table only contains the last hypervisorname instead of all. What am I doing wrong here?
Get all Poolmaster IPs from XenDesktop broker
$poolmasterips = get-ChildItem xdhyp:\connections -AdminAddress $stradminaddress | select -ExpandProperty HypervisorAddress -Unique
foreach ($poolmasterip in $poolmasterips)
{
Get hypervisorconnection names from pool master IP
$hypervisorname = get-childitem xdhyp:\connections -AdminAddress $stradminaddress | where {$_.HypervisorAddress -eq $poolmasterip} | select -ExpandProperty HypervisorConnectionName
$hypervisornamelist = @{
name = $hypervisorname
}
}
Regards
Christian