Skip to content

Instantly share code, notes, and snippets.

@stusklinar
Last active January 28, 2020 10:03
Show Gist options
  • Save stusklinar/4c97627826c46c155f90204b2b4cb290 to your computer and use it in GitHub Desktop.
Save stusklinar/4c97627826c46c155f90204b2b4cb290 to your computer and use it in GitHub Desktop.
$collectionurl = "https://azure-devops-url"
$collectionName= "DefaultCollection"
$projectName= "Development"
$baseUrl = "${collectionurl}/$collectionName/$projectName/_apis/build"
$buildDefsReq = (Invoke-RestMethod -Uri $baseUrl/Definitions/ -Method Get -UseDefaultCredential)
foreach($def in $buildDefsReq.value){
$buildDef = (Invoke-RestMethod -Uri $baseUrl/Definitions/$($def.id) -Method Get -UseDefaultCredential)
if($buildDef.repository.type -notlike "TfsGit"){
write-host $buildDef.name
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment