PowerCLI by VMWmare is a tried and tested way of scripting management of a vSphere instance using PowerShell. This short tutorial is a prerequisite for the rest of the series on vSphere. 
Open a PowerShell terminal as administrator and run the following commands:
#Install PowerCLI
Install-Module VMware.PowerCLI -AllowClobber -Force

#Disable Certificate Verficiation (Don't use this in production)
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false

#Disable CEIP Telemetry
Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP:$false

#Save vSphere credentials
New-VICredentialStoreItem -Host <vSphere FQDN or IP> -User "<username>@domain.com" -Password "<password>"

#Test your connection to a vSphere Server
Connect-VIServer <vSphere FQDN or IP>