Advertisement
Guest User

Untitled

a guest
Jan 25th, 2018
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $user = "admin"
  2. $password = ""
  3. $teamCityHost = "http://test.net/"
  4. $pair = "$($user):$($password)"
  5.  
  6. $encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
  7. $basicAuthValue = "Basic $encodedCreds"
  8. $headers = @{
  9.     "Authorization" = $basicAuthValue;
  10.     "Accept" = "application/xml";
  11.     "Content-Type" = "application/xml";
  12. }
  13.  
  14. $buildId = "CrmAutomationTests_RunFailedTestList"
  15. $body = "<build><buildType id=""$buildId""/></build>"
  16. $api = "$($teamCityHost)httpAuth/app/rest/buildQueue"
  17. $response = Invoke-WebRequest -Uri $api -Headers $headers -Method POST -Body $body
  18. if(200 -ne $response.StatusCode){
  19.   exit 1
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement