Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 252940

Re: Create Parameters for WriteData function

$
0
0

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


Viewing all articles
Browse latest Browse all 252940

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>