You should sort on the Name property, not on the object.
Like this
foreach ($Cluster in (Get-Cluster -Location $Datacenter | Sort-Object -Property Name)) {
You should sort on the Name property, not on the object.
Like this
foreach ($Cluster in (Get-Cluster -Location $Datacenter | Sort-Object -Property Name)) {