Skip to content

Instantly share code, notes, and snippets.

@scottcowan
Last active October 27, 2016 12:32
Show Gist options
  • Save scottcowan/3aff2fa957a0a75fa4bd48960fb1257c to your computer and use it in GitHub Desktop.
Save scottcowan/3aff2fa957a0a75fa4bd48960fb1257c to your computer and use it in GitHub Desktop.
VSTS Queue a build
#In VSTS set Options > Allow Scripts to Access OAuth Token or you'll get an error
invoke-webrequest
-Method POST
https://<your site>/DefaultCollection/Digital%20Apprenticeship%20Service/_apis/build/builds?api-version=2.0
-Body "{'definition':{'id': 1}}"
-headers @{"Authorization"="Bearer $(System.AccessToken)"}
-usebasicparsing
-ContentType "application/json"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment