Prepare the connection to the vCenter
Before you can use PowerCLI you have to configure the behavior of PowerCLI if the vCenter provides an unknown certificate. Under normal circumstances β when I am in a separated and firewalled environment, I configure PowerCLI to ignore unknown certificates.
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore https://vdc-repo.vmware.com/vmwb-repository/dcr-public/847b8d79-9752-43d3-8217-8270ab647679/9e3681cf-989d-4bf9-94b2-30dd819f9abc/GUID-875C2A87-0AC9-4B28-9361-5B283AFE114E.html You need to do this only the first time you use PowerCLI on a system!
A confirmation screen appears, select "Yes to All"
Probably there is a message shown that you should join the VMware Customer Experience Improvement Program.

You can deactivate this with the following command
A confirmation screen appears, select "Yes to All"
Set the option to connect to multiple vcenter at the same time
A confirmation screen appears, select "Yes to All"
Depending on your Security demand you have to set the Powershell Execution Policy.
There are several options for the execution policy:
AllSigned Requires that all scripts and configuration files be signed by a trusted publisher, including scripts written on the local computer.
Bypass Nothing is blocked, and there are no warnings or prompts.
Default Sets the default execution policy. Restricted for Windows clients or RemoteSigned for Windows servers.
RemoteSigned Requires that all scripts and configuration files downloaded from the internet are signed by a trusted publisher. The default execution policy for Windows server computers.
Restricted Does not load configuration files or execute scripts. The default execution policy for Windows client computers.
Undefined No execution policy is set for the scope. Removes an assigned execution policy from a scope not defined by a Group Policy. If the execution policy is Undefined in all scopes, the effective execution policy becomes Restricted.
Unrestricted Starting with PowerShell 6.0, this is the default execution policy for non-Windows computers and cannot be changed. It loads all configuration files and executes all scripts. If you run an unsigned script downloaded from the internet, you will be prompted for permission before execution.
Syntax:
After this you can connect to the vCenter
Last updated