$Clusters = get-cluster
$Result =@(
Foreach ($Cluster in $Clusters)
{
$VMhosts = Get-VMHost -Location $Cluster
foreach($VMhost in $VMhosts)
{
[pscustomobject]@{
“Host” = $VMhost.Name
“Cluster Name” = $Cluster
}
}
}
)
$Result
$Clusters = get-cluster
$Result =@(
Foreach ($Cluster in $Clusters)
{
$VMhosts = Get-VMHost -Location $Cluster
foreach($VMhost in $VMhosts)
{
[pscustomobject]@{
“Host” = $VMhost.Name
“Cluster Name” = $Cluster
}
}
}
)
$Result