It might be that one of the VMware services is not running on the vCenter server. Probably the "VMware VirtualCenter Management Webservices" service.
This is probably due to your proxy settings.
Use the following cmd to set your powercli to bypass the proxy and try connecting again:
Set-PowerCLIConfiguration -Proxy "NoProxy"
How to no prompt for below command
Set-PowerCLIConfiguration -ProxyPolicy NoProxy: its asking Yes ,ALL... options
I want default as Yes
Did you use the -Confirm:$false switch?
If not, the cmdlet will ask for confirmation.