diff --git a/images/macos/provision/core/commonutils.sh b/images/macos/provision/core/commonutils.sh index 946dd4807..f51d9b9ec 100644 --- a/images/macos/provision/core/commonutils.sh +++ b/images/macos/provision/core/commonutils.sh @@ -19,6 +19,9 @@ done # Invoke bazel to download bazel version via bazelisk bazel +# Install Azure DevOps extension for Azure Command Line Interface +az extension add -n azure-devops + # Workaround https://github.com/actions/virtual-environments/issues/4931 # by making Tcl/Tk paths the same on macOS 10.15 and macOS 11 if is_BigSur; then diff --git a/images/macos/software-report/SoftwareReport.Common.psm1 b/images/macos/software-report/SoftwareReport.Common.psm1 index 129ebdd33..b3282b109 100644 --- a/images/macos/software-report/SoftwareReport.Common.psm1 +++ b/images/macos/software-report/SoftwareReport.Common.psm1 @@ -422,6 +422,11 @@ function Get-AzureCLIVersion { return "Azure CLI $azureCLIVersion" } +function Get-AzureDevopsVersion { + $azdevopsVersion = (az version | ConvertFrom-Json).extensions.'azure-devops' + return "Azure CLI (azure-devops) $azdevopsVersion" +} + function Get-AWSCLIVersion { $awsVersion = Run-Command "aws --version" | Take-Part -Part 0 | Take-Part -Delimiter "/" -Part 1 return "AWS CLI $awsVersion" diff --git a/images/macos/software-report/SoftwareReport.Generator.ps1 b/images/macos/software-report/SoftwareReport.Generator.ps1 index 22a99a027..e74d87816 100644 --- a/images/macos/software-report/SoftwareReport.Generator.ps1 +++ b/images/macos/software-report/SoftwareReport.Generator.ps1 @@ -155,6 +155,7 @@ $toolsList = @( (Get-CmakeVersion), (Get-AppCenterCLIVersion), (Get-AzureCLIVersion), + (Get-AzureDevopsVersion), (Get-AWSCLIVersion), (Get-AWSSAMCLIVersion), (Get-AWSSessionManagerCLIVersion) diff --git a/images/macos/tests/BasicTools.Tests.ps1 b/images/macos/tests/BasicTools.Tests.ps1 index 96d4f6e81..7815ae9b5 100644 --- a/images/macos/tests/BasicTools.Tests.ps1 +++ b/images/macos/tests/BasicTools.Tests.ps1 @@ -6,6 +6,12 @@ Describe "Azure CLI" { } } +Describe "Azure DevOps CLI" { + It "az devops" { + "az devops -h" | Should -ReturnZeroExitCode + } +} + Describe "Carthage" { It "Carthage" { "carthage version" | Should -ReturnZeroExitCode