Connect vCenter or ESXi Host From vSphere Power CLI
> Connect-VIServer “vCenter Name / IP ”
It will ask for user name and password to access vCenter , or alternate we can add username and password to same line .
Use the below basic commands
> Get-Esx “ESx hostname/ IP ”
You have to type in the credential box that pops up when the credentials parameters are omitted.
> Connect-VIServer “vCenter Name / IP ” -user “username” -password “password “