function Load-PowerCLI
{
Add-PSSnapin VMware.VimAutomation.Vds
. "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1"
Connect-VIServer -Server "Server"
Replace the "Server" with your vSphere address / hostname,
You will receive a prompt for user name and password -
For some reason, since we are using the ISE interface we need to switch to the new PS-Drive created for us, in order to run PowerCLI commands.
cd vi:\
you may check your connection to the vSphere using a PowerCLI command, example -
get-vm