You may encounter the following error message:
This happens because you try to pass the password as a regular string.
You must use a secure string instead.
For example convert your string with the ConvertTo-SecureString cmdlet.
Or, if you use the Read-Host cmdlet, associate it with the AsSecureString parameter.