Skip to content

Instantly share code, notes, and snippets.

@shibayan
Created April 6, 2020 16:47
Show Gist options
  • Select an option

  • Save shibayan/a7f817bdcac71447e6b9e677233a0b31 to your computer and use it in GitHub Desktop.

Select an option

Save shibayan/a7f817bdcac71447e6b9e677233a0b31 to your computer and use it in GitHub Desktop.
param ([string] $url, [string] $token, [string] $pool, [string] $agent)
mkdir "c:\agent"
cd "c:\agent"
Invoke-WebRequest -Uri https://vstsagentpackage.azureedge.net/agent/2.165.2/vsts-agent-win-x64-2.165.2.zip -Out vsts-agent-win-x64.zip
Expand-Archive -Path vsts-agent-win-x64.zip -DestinationPath $PWD
del vsts-agent-win-x64.zip
.\config.cmd --unattended --url "$url" --auth pat --token "$token" --pool "$pool" --agent "$agent" --replace --runAsService
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment