I'm trying to make a PowerShell script containing Azure CLI commands to retrieve the information about the repos, I'm new to azure DevOps.
Information that I'm trying to gather is the list of repos, their branches, the latest commits, and the author.
I've gone through the AZ Repos docs but I'm not able to execute it properly, here's the code I've done so far.
$orgUrl = "https://dev.azure.com/{MyOrganization}"
$ProjectUrl = "https://dev.azure.com/{MyOrganization}/_apis/git/repositories?api-verepo_demo/sion=4.1"
$env:SYSTEM_ACCESSTOKEN | az devops login --org $org --project $ProjectUrl
foreach ($Proj in $ProjectUrl)
{
$Repos = az repos list --organization $orgUrl --project $Proj | ConvertFrom-Json
foreach ($Repo in $Repos) {
Write-Output $Repo.webUrl
}