jabbera / my-vsts-tasks

20 stars 18 forks source link

Invalid character in password for task Install Topshelf Service #15

Closed kasperhj closed 6 years ago

kasperhj commented 6 years ago

When the running the task Install Topshelf Service, I get the following error

2017-10-19T08:22:43.3369874Z Performing deployment in parallel on all the machines.
2017-10-19T08:22:43.3526129Z Deployment started for machine: test with port 5985.
2017-10-19T08:22:53.6606151Z Deployment status for machine test : Failed
2017-10-19T08:22:53.6762372Z Deployment failed on machine test with following message : System.Exception: At line:3 char:143
2017-10-19T08:22:53.6762372Z + ... assword:******** -instance:MyService -servicename:MyServiceName ...
2017-10-19T08:22:53.6762372Z +                    ~
2017-10-19T08:22:53.6762372Z Unexpected token '}' in expression or statement.
2017-10-19T08:22:53.6762372Z 
2017-10-19T08:22:53.6762372Z At line:4 char:141
2017-10-19T08:22:53.6762372Z + ... assword:******** -instance:MyService -servicename:MyServiceName ...
2017-10-19T08:22:53.6762372Z +                    ~
2017-10-19T08:22:53.6762372Z Unexpected token '}' in expression or statement.

I suspect the final character in the password ! is causing this issue.

didaskein commented 6 years ago

Same issue with a '@' character in the password... i get it work by modifing one line of code in InstallTopshelfService.ps1 :

$servicePassword = $servicePassword.Replace('`', '``').Replace('"', '`"').Replace('$', '`$').**Replace('@', '`@')**.Replace('&', '`&').Replace('''', '`''').Replace('(','`(').Replace(')','`)')

Could you integrate the modification in the code ?

Thank you in advance,

jabbera commented 6 years ago

I’ll get to this someone next week. Thanks for the bug reports!

jabbera commented 6 years ago

This should be resolved with the new version. It's been published as a new major so it's opt in.