Skip to content

Instantly share code, notes, and snippets.

@flcdrg
Created June 5, 2023 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flcdrg/c87cecfc8ceaa19ae19efa53b5fcf3af to your computer and use it in GitHub Desktop.
Save flcdrg/c87cecfc8ceaa19ae19efa53b5fcf3af to your computer and use it in GitHub Desktop.
Azure DevOps REST APIs
Param(
[string]$organisation,
[string]$project,
[int] $releaseId,
[string]$token
)
$base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f "",$token)))
# https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/releases/{releaseId}?approvalFilters={approvalFilters}&propertyFilters={propertyFilters}&$expand={$expand}&$topGateRecords={$topGateRecords}&api-version=7.0
$uri = "https://vsrm.dev.azure.com/$($organisation)/$($project)/_apis/release/releases/$($releaseId)?propertyFilters=Example&api-version=7.0"
$uri
$result = Invoke-RestMethod -Uri $uri -Method Get -Headers @{Authorization=("Basic {0}" -f $base64AuthInfo)}
$result.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment