When you run PowerCLI for the first time after fresh install you might get an error similar to this one. This is because your computer Powershell policy is set to restricted. You can check your current execution policy by running Get-ExecutionPolicy command.
. : File C:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1 cannot be
loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at
At line:1 char:3
+ . “C:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Scripts\Init …
+ CategoryInfo : SecurityError: (:) , PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
In order to change execution policy you need to run Set-ExecutionPolicy RemoteSigned command.
Confirm changes by running commmand Get-ExecutionPolicy. You should see now that your policy is RemoteSigned now.