VMware Cloud Community
Leo0601
Enthusiast
Enthusiast
Jump to solution

Needs to execute some powerCLI comments in the vCenter by sorting out the ESXI model (Gen9)

Hi Experts,

I wanted to run some powerCLI comments in vCenter that comment needs to fetch all the available esxi in vCenter and apply only when  ESXi server is Gen9. Could someone give me the logic to sort out the Gen9 esxi servers and execute my comments

@scott28tt Thanks Scott for letting me post my powershell-related post here. 

@LucD  Earlier I have posted my question in different place. Hope this is the right place for Powershell.  I am looking forward to hearing from you. Could you please post your answer here. 

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Try with

Get-VMhost |
Where{$_.ExtensionData.Hardware.SystemInfo.Model -match 'Gen9'} |
Foreach-Object -Process {
# Your commands
}


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

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

Try with

Get-VMhost |
Where{$_.ExtensionData.Hardware.SystemInfo.Model -match 'Gen9'} |
Foreach-Object -Process {
# Your commands
}


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

0 Kudos
Leo0601
Enthusiast
Enthusiast
Jump to solution

@LucD 

Hi Expert

Thanks Much. 

Your code is perfect. ::)

Working as expected. Marked your answer as the right answer. 


0 Kudos