When you provide login credentials in the command prompt or in a script file, a PowerShell limitation might prevent PowerCLI from processing non-alphanumeric characters correctly. To prevent login problems, escape the non-alphanumeric characters in your credentials.

To escape non-alphanumeric characters in PowerCLI, you need to place the expression that contains them in single quotes (').


When you provide your login credentials in the Specify Credential dialog box, you do not need to escape non-alphanumeric characters.

This example illustrates how to escape non-alphanumeric characters when connecting to a selected vCenter Server instance with the Adminis!ra!or user name and the pa$$word password.

Connect-VIServer -Server -Protocol https -Username 'Adminis!ra!or' -Password 'pa$$word'