On client systems with fresh PowerCLI installations I often get an error when trying to run scripts.
Connect-VIServer Error: Invalid server certificate. Use Set-PowerCLIConfiguration to set the value for the InvalidCertificateAction option to Prompt if you’d like to connect once or to add a permanent exception for this server
The reason is that PowerCLI refuses to run scripts with invalid certificates. If you’re running your own scripts, you can switch off that feature.
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false