VMware Cloud Community
chicagovm
Enthusiast
Enthusiast

Joining 2 PowerCLI scripts for all hosts in a particular Datacenter = Set-AdvancedSetting

I am trying to run two scripts in the Set-AdvancedSetting -Value for alll hosts in a particular "Datacenter".

How would I create one script that sets the Adv settings without me actually manually starting the second one? Please help if you can.

#Set Hostd logging level to info (default is verbose)

Get-VMHost xxhost01.sidley.com | Get-AdvancedSetting -Name Config.HostAgent.log.level | Set-AdvancedSetting -Value "info" -Confirm:$false

#Set Vpxa logging level to info (default is verbose)(must be connected to VC)

Get-VMHost xxhost01.sidley.com | Get-AdvancedSetting -Name Vpx.Vpxa.config.log.level | Set-AdvancedSetting -Value "info" -Confirm:$false

There are multiple hosts all in the same Datacenter .. "Zed".


How can I run both scripts on all the hosts?

Thank you very much..

Tags (1)
0 Kudos
1 Reply
vijayrana968
Virtuoso
Virtuoso

0 Kudos