Closed biltongza closed 5 years ago
@biltongza you need to quote or escape the &
in powershell, since it's a keyword in powershell
I know, that's why I used single quotes instead of double quotes, and also why I tried using it as a variable. Both cases seem to be failing within the process.
@biltongza can you try run the same command in a command prompt instead of PowerShell? it sounds like a PowerShell escaping problem. try use \&
?
i am going to close this issue for now since it's sounds like a powershell escaping problem, please re-open if you need more help.
Apologies, our infrastructure team actually rolled us back to TFS 2015 👎 when they decide to try the 2018 upgrade again, I will have a chance to try this again.
This is also a problem in Azure DevTest Labs. Adding the Azure Pipelines Agent to a VM and configuring it through the web UI fails with this exact error message when there is an &
in the password, whether it is a shared secret or hardcoded.
@brownbl1 sounds like a bug in Azure DevTest Labs, they don't properly escape special powershell keywords. i think you can report at https://feedback.azure.com/forums/34192--general-feedback
None of the above worked for me. In my case the issue was due to an & as special character.
$password = "b&d9oVyEY1SJRJog8j" .\config.cmd --unattended --url $url --auth pat --token $token --pool $pool --agent $agent --runAsService --windowsLogonAccount $user --windowsLogonPassword """$password""" --replace
For me what worked is above. triple quote your password variable as shown above
Have you tried trouble shooting?
Trouble shooting doc Yes
Agent Version and Platform
Version of your agent? 2.102.0/2.100.1/... 2.131.0
OS of the machine running the agent? OSX/Windows/Linux/... Server 2012 R2
VSTS Type and Version
VisualStudio.com or On-Prem TFS? On-Prem
If On-Prem TFS, which release? 2015 RTM/QU1/QU2/... Version 16.131.27701.1
What's not working?
I am trying to install an agent over a remote powershell session. My command line looks like this:
.\config.cmd --unattended --url <Url goes here> --auth negotiate --userName <my username> --password <my password> --pool AIMS-Build --agent XZAOBCC2WEB0344.Build.1 --acceptTeeEula --runAsService --windowsLogonAccount <service account name> --windowsLogonPassword '<service account password>'
This is the output I get:
Immediately following this, I get a message saying the text after the
&
in the passwordis not recognized as an internal or external command, operable program or batch file
.For example if my password for the service account were
my&password123!
I would get the following output:I have also tried specifying the password as a variable(
$password = 'password goes here'
and then--windowsLogonPassword $password
but that does the same thing.I believe the configuration script is not escaping user input correctly. We had a problem with TFS 2015 agents where the password had a
"
character in it that would break scripts, and we wound up having to remove the quote from the password to get anything to work.Agent and Worker's Diagnostic Logs