Hi Luc
I was able to sort by Datacenter:
# Function to perform the work for the data you need
Function GetCluster {
& { foreach ($Datacenter in (Get-Datacenter | Sort-Object $Datacenter)) {
foreach ($Cluster in (Get-Cluster -Location $Datacenter)) {
$clusObj = New-Object -TypeName PSObject -Property @{
vCenter = $Datacenter.Uid.Split("@")[1].Split(":")[0]
Datacenter = $Datacenter.Name
Cluster = $Cluster.Name
HAEnabled = $Cluster.HAEnabled
DrsEnabled = $Cluster.DrsEnabled
DrsMode = $Cluster.DrsMode
}
writedata $clusObj
}
}
}
}
but when I try to sort by vCenter or Cluster I get a sort-object not suppoerted error