I have recently been working on a fair bit of PowerCLI for a Cyber Defense competition called NECCDC. Every time, when I connect to vCenter, I receive this following error.
This error occurs when the default VMWare certificates are not replaced with trusted/matching ones.
To resolve this, you need to run the following command.
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false
This command will ignore all invalid certs from your vCenter server. It is equivalent to clicking “Install this certificate and do not display any security warning” from the old vSphere Client.
(Photo from https://www.itzgeek.com/how-tos/virtualization/how-to-install-vsphere-client-5-step-by-step.html)
With this command set, you can not connect to your vCenter server and in this case, listing out the currently configured port groups.