I'm trying to download a file with the Azure Devops Rest API using Powershell's Invoke-RestMethod. It always seems to download from the main branch and ignores my branch specification
The urls I'm using are
invoke-restmethod -uri "https://dev.azure.com/company/xxx/_apis/git/repositories/xxx/items?path=%2Fpom.xml&commitOrBranch=main&api-version=6.0" -Method Get -ContentType "application/text" -Headers $headers
and
invoke-restmethod -uri "https://dev.azure.com/company/xxx/_apis/git/repositories/xxx/items?path=%2Fpom.xml&commitOrBranch=branchName&api-version=6.0" -Method Get -ContentType "application/text" -Headers $headers
How do I specify the branch? The documentation doesn't provide any details