Created
April 3, 2017 13:08
-
-
Save JeremyNevill/b288a18c0ceabc48dc553f18fa992b30 to your computer and use it in GitHub Desktop.
AutoInstallAndRegisterVSTSAgent2017.ps1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $VSTSAgentFileName="vsts-agent-win7-x64-2.105.7.zip" | |
| $VSTSAgentDownloadUrl="http://yourvstsagentdownloadserver/" + $VSTSAgentFileName | |
| $TempFolder="c:/Temp/" | |
| $VSTSAgentDownloadPath=$TempFolder + $VSTSAgentFileName | |
| $VSTSAgentFolder="c:/vsts_agent" | |
| $TFSServerUrl="http://yourtfsserver:8080/tfs" | |
| function Download-VSTSAgent{ | |
| Write-Host("Downloading: " + $VSTSAgentDownloadUrl) | |
| Write-Host("To: " + $VSTSAgentDownloadPath) | |
| $WebClient = new-object System.Net.WebClient | |
| $WebClient.DownloadFile($VSTSAgentDownloadUrl, $VSTSAgentDownloadPath) | |
| } | |
| function Unzip-VSTSAgent{ | |
| Write-Host("Unzipping: " + $VSTSAgentDownloadPath) | |
| Write-Host("To: " + $VSTSAgentFolder) | |
| Add-Type -assembly "system.io.compression.filesystem" | |
| [io.compression.zipfile]::ExtractToDirectory($VSTSAgentDownloadPath, $VSTSAgentFolder) | |
| } | |
| function Register-VSTSAgent{ | |
| cd $VSTSAgentFolder | |
| & .\config.cmd --unattended --auth Negotiate --username yourdomain\yourusername --password yourpw --url $TFSServerUrl --pool yourpool | |
| } | |
| Download-VSTSAgent | |
| Unzip-VSTSAgent | |
| Register-VSTSAgent | |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As seen at http://stackoverflow.com/questions/42816956/ephemeral-tfs-build-agent-setup