Last active
October 21, 2021 19:26
-
-
Save dylanberry/7c7c4e8746270fcee207981e5b0d9b10 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
az login | |
$azureDevopsResourceId = "499b84ac-1321-427f-aa17-267ca6975798" | |
$token = az account get-access-token --resource $azureDevopsResourceId | ConvertFrom-Json | |
$authValue = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes(":" + $token.accessToken)) | |
$headers = @{ | |
Authorization = "Basic $authValue"; | |
'X-VSS-ForceMsaPassThrough' = $true | |
} | |
$organization = "myorg" | |
$pipelineRunUrl = "https://dev.azure.com/$organization/_apis/projects" | |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
Invoke-RestMethod -Uri $pipelineRunUrl -Method GET -Headers $headers -ContentType 'application/json' -Verbose |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment