API request to Azure DevOps from PowerShell

$urlvsts = 'https://dev.azure.com/PROJECT-NAME'
$token = 'YOUR-PAT-TOKEN'
$pool = 'YOUR-POOL-NAME'
$encodedPat = [System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes( ":$token"))
$body = "{name:`"$pool`", autoProvision: `"true`"}"
Invoke-WebRequest `
-Method POST `
-Uri "$urlvsts/_apis/distributedtask/pools?api-version=5.0- preview.1" `
-UseBasicParsing `
-Headers @{Authorization = "Basic $encodedPat"} `
-Body $body `
-ContentType "application/json"

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store