I have the following code
$Password = 'Test&&'
$securePassword = ConvertTo-SecureString $Password -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential($userName,$securePassword)
Add-AzureAccount -Credential $cred
I am unable to connect to my Azure-Account if I set my password having &
in it. I am not sure does the Convert-To is treating & as any special character.
Setting other special character such as %
in the password works smoothly for me.
I have tried applying escape characters before &
in my password but it didn't worked.
Any help would be highly appreciated on this.