With the release of VMware PowerCLI 12.4 I was updating the module on my LAB servers so I could check out the new command.
When upgrading I was getting the below error which is due to VMware changing the certificate authority used to publish the new module.
Authenticode issuer ‘Efirstname.lastname@example.org, CN=”VMware, Inc.”, O=”VMware, Inc.”, L=Palo Alto, S=California, C=US’ of the new module ‘VMware.VimAutomation.Sdk’ with version ‘126.96.36.19927054’ from root certificate authority.
In the release notes from VMware there is a know issue with the certificate. The fix is to remove and re-install the module.
Now that we have the command we can start to build out a script to export information.
In this case we will be getting all hosts, listing all NIC’s and getting the drivers info.
The above shows that Get-EsxCli can be very good for retrieving information, if we wanted to set a configuration we can use similar command syntax but use the set method.
In this case we will update the Power policy settings on all host, we could do this manually by going to the Configure > Hardware > Overview > Power Management one each host and update the power policy settings
but doing this on a larger cluster is a lot of effort. To update using PowerCli we can first create the script to report on the current host power policy.
To update the policy settings we will use the set method like the below.