Hello,
I'm having trouble passing a password. The password is entered in a dialog box during installation and then verified using an inline PowerShell script before starting the installation process. The password is passed to the script as a command-line argument: -User [USER_PROP] -Password [PASSWORD_PROP]
USER_PROP and PASSWORD_PROP are values taken straight from the dialog textfields.
PASSWORD_PROP may contain special characters such as " or ' or &. How can I pass the password if I don’t know which special characters it contains? If it starts with ", I get an error as soon as I pass it.
ERROR: At line:1 char:121
+ ... ogram Files `(x86`)\Common Files\" -User test -Password "Qwert123`&ÖÄ
+ ~~~~~~~~~~~~~
The string is missing the terminator: ".
I know it's the " in the password, but it could be a ' as well. How can I avoid the error?
Thank you for your help,
Portalman66
FOLLOW US
Get the latest news in Application Packaging