Skip to content

Instantly share code, notes, and snippets.

@jincod
Created November 21, 2014 10:23
Show Gist options
  • Save jincod/03ed02181c83faf93081 to your computer and use it in GitHub Desktop.
Save jincod/03ed02181c83faf93081 to your computer and use it in GitHub Desktop.
Get changes from TeamCity build
$buildId = 10048
$teamcityUrl = "http://teamcity:8080"
$auth = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("username:password"))
@((Invoke-RestMethod $teamcityUrl/httpAuth/app/rest/changes?build=id:$buildId -Headers @{"Authorization" = "Basic $auth"}).changes.change) | % { (Invoke-RestMethod $teamcityUrl/httpAuth/app/rest/changes/id:$($_.id) -Headers @{"Authorization" = "Basic $auth"}).change.comment}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment