-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing quotes in specifying args for $configArgs at install-vstsagent #23
Comments
Good find! PRs welcome! =) |
As a workaround, I believe that since the pool is just a string forwarded through you could surround it in quotes before passing it in. |
Yeah that workaround might work yea. I may actually look into updating some code on this DSC module. I'll take a look at contributing. |
I actually ran into this issue recently with a password. The password had an "&" for @jwittner I can add quotes to the variables and submit a PR. I did a small test to understand what is occurring. In the example below, I quoted |
@ps-tb - You're seeing that output because you have to wrap variables with |
Following piece of code (line 294 - 298 in install-vsts):
[string[]]$configArgs = @('--unattended', '--url', "$ServerUrl", '--auth', ` 'pat', '--pool', "$Pool", '--agent', "$Name", '--runAsService') if ( $Replace ) { $configArgs += '--replace' } if ( $LogonCredential ) { $configArgs += '--windowsLogonAccount', $LogonCredential.UserName } if ( $Work ) { $configArgs += '--work', $Work }
Does not include quotes in the string. For instance "$Pool" will only pass the $Pool parameter and not put it in (single) quotes for the eventual command.
So for instance when passing a Agent pool name like Pool 001 the command line args will be "--pool Pool 001" and not "--pool 'Pool 001'.
Becouse of this the script is not able to handle Agent pools that contain spaces.
The text was updated successfully, but these errors were encountered: