Am working on PowerShell script where I am trying to get project id of an existing one in Azure DevOps account. For that, am used following script:
$AzureDevOpsPAT = "l7zybu-XXX-XXXX-XXXXX"
$OrganizationName = "OrgName"
$projectName = "XXXXXX"
$AzureDevOpsAuthenicationHeader = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(":$($AzureDevOpsPAT)")) }
$UriOrga = "https://$($OrganizationName).visualstudio.com/"
$UriOrga
$uriAccount = $UriOrga + "_apis/projects?api-version=6.0"
Invoke-RestMethod -Uri $uriAccount -Method get -Headers $AzureDevOpsAuthenicationHeader | where({ $_.name -eq $projectName })
After running this script am not getting any type of Output in logs, it's just executing? Could you please help me to find solution for this.
| where({ $_.name -eq $projectName })and there isn't a match. Remove that and see what it returns.