Powershell & PowerCLI Prep
#Set Execution Policy
Set-ExecutionPolicy RemoteSigned
#Ignore SSL Certificates warnings
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -WarningAction SilentlyContinue
#Connecting to server & save creds:
Connect-VIServer vCenter.DOMAIN.com -User DOMAIN\Administrator -Password -SaveCredentials
#Location to open up PowerCLI normally:
. "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1"
CMDLET
function Load-PowerCLI { Add-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue Add-PSSnapin VMware.VumAutomation -ErrorAction SilentlyContinue Add-PSSnapin VMware.DeployAutomation -ErrorAction SilentlyContinue Add-PSSnapin VMware.DeployAutomation -ErrorAction SilentlyContinue & "C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1" Write-Host "================================================" -ForegroundColor White Write-Host " ...connecting to vCenter servers " Connect-VIServer vCenter0.groffbox.com }
BONUS:
Set the VMConsole to open correctly with Open-VMConsole Window
#Download and Install 32-bit Firefox, you NEED 32-bit
#Run:
Set-PowerCLIConfiguration –VMConsoleWindowBrowser “C:\Program Files (x86)\Mozilla Firefox\firefox.exe”
Now you can run Open-VMConsoleWindow