VMware Cloud Community
paullee92
Enthusiast
Enthusiast
Jump to solution

Determining esxi host info

I am running below code and would like to add few column such as displaying the esxi host cluster name, EVC mode, Current EVC Mode and Supported EVC Modes.

code:

Get-Cluster | Get-VMHost | Select-Object -Property Name,Manufacturer,Model,ProcessorType,
@{Name="NumCpuCores";Expression={$_.ExtensionData.hardware.CpuInfo.NumCpuCores}},
CpuTotalMhz, MaxEVCMode

 

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You could do something like this

Get-Cluster -PipelineVariable cluster | Get-VMHost | 
Select-Object -Property Name,
@{N='Cluster';E={$cluster.Name}},
@{N='EVCMode';E={$cluster.EvcMode}},
@{N='SupportedEVCMode';E={
    $script:evcMgr = Get-View -Id ($cluster.ExtensionData.EVCManager())
    $script:evcMgr.EvcState.SupportedEVCMode.Key -join '|'}},
@{N='CurrentEvcMode';E={$script:evcMgr.EvcState.CurretnEVCModeKey}},
Manufacturer,Model,ProcessorType,
@{Name="NumCpuCores";Expression={$_.ExtensionData.hardware.CpuInfo.NumCpuCores}},
CpuTotalMhz, MaxEVCMode


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
1 Reply
LucD
Leadership
Leadership
Jump to solution

You could do something like this

Get-Cluster -PipelineVariable cluster | Get-VMHost | 
Select-Object -Property Name,
@{N='Cluster';E={$cluster.Name}},
@{N='EVCMode';E={$cluster.EvcMode}},
@{N='SupportedEVCMode';E={
    $script:evcMgr = Get-View -Id ($cluster.ExtensionData.EVCManager())
    $script:evcMgr.EvcState.SupportedEVCMode.Key -join '|'}},
@{N='CurrentEvcMode';E={$script:evcMgr.EvcState.CurretnEVCModeKey}},
Manufacturer,Model,ProcessorType,
@{Name="NumCpuCores";Expression={$_.ExtensionData.hardware.CpuInfo.NumCpuCores}},
CpuTotalMhz, MaxEVCMode


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos