When you provide login credentials in the command prompt or in a script file, a PowerShell limitation might prevent vSphere 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 vSphere PowerCLI, you need to place the expression that contains them in single quotes (').
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 10.23.112.235 -Protocol https -Username 'Adminis!ra!or' -Password 'pa$$word'