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

Re: Create Parameters for WriteData function

$
0
0

This is what I tried:

 

foreach ($Cluster in (Get-Cluster -Location $Datacenter | Sort-Object $Cluster)) {

 

What I am trying to accomplish is to have the report sorted in the order as ii looks when you open the vSphere client.

 

I've tried to sort by vCenter but I'm not getting the desired results:

 

# Function to perform the work for the data you need
Function GetCluster {
    & { foreach ($Datacenter in (Get-Datacenter)) {
            foreach ($Cluster in (Get-Cluster -Location $Datacenter)) {
                $clusObj = New-Object -TypeName PSObject -Property @{
                    vCenter = $Datacenter.Uid.Split("@")[1].Split(":")[0] | Sort-Object -Property Name
                    Datacenter = $Datacenter.Name             
                    Cluster = $Cluster.Name                  
                    HAEnabled = $Cluster.HAEnabled                   
                    DrsEnabled = $Cluster.DrsEnabled                   
                    DrsMode = $Cluster.DrsMode
                   
                    }
                writedata $clusObj
                     
             }
        }
    }
}


Viewing all articles
Browse latest Browse all 252940

Trending Articles



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