A while ago I was looking at installing the VSTS build Agent on Linux and was searching for the possibility to uninstall it unattended. I was doing this because I wanted to run my agent in a Docker container and on startup I wanted to run a configured agent. I solved ths by using an expect file on Linux. Take a look at my post how I did this.
Back then. There was no possibility for an unattended configuration in Windows as well. But as I was researching some stuff with the windows Build Agent, I found out that now there IS a possibility to configure the BuildAgent in script.
I downloaded the last version of the agent from my Visual Studio Team Services Account.
And then In unpacked the zip to my local disk. In my case to c:\agent\
With a command prompt navigate to this directory and run
And you get a whole list of options
When you run
.\agent\VsoAgent.exe /configure /serverUrl:https://server.visualstudio.com /name:NameOfYourVSTSAgent /Poolname:Default /Login:<alternate username>,<alternate password>;AuthType=Basic /force /workfolder:"c:\agent\_work" /runningasservice:N /noprompt /force
You automatically configure a Build Agent against your VSTS account. Make sure you have set up Alternate credentials that you can use in this command line.
This is perfect when you want to test some builds locally. Create a batch file, run the file and you have a local build agent.
Happy building !