Hi, I want to auto-load all PowerCLI 6.0 modules into PowerShell ISE session (or standard PowerShell console). PowerCLI 6.0 was installed under my standard domain account with admin rights on my laptop. However I always run PowerShell console and ISE with run as and use my domain admin account. Having done so path to VMware modules was not automatically added to $env:PSModulePath variable. I created profile.ps1 file with the following content:
$env:PSModulePath = $env:PSModulePath + “;C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Modules”
Connect-VIServer vcenter -User myuser -Password mypassword
However Connect-VIServer cmdlet has not been recognized i.e. auto-load of VMware modules did not work. When I added line Import-Module VMware.VimAutomation.Core, before Connect-VIServer . . . the latter will work but I do not know why auto-load did not work since path to modules was added to $env:PSModulePath - Import-Module should be redundant step.