From e66f7c0790e0a9d00753dbac5aca6b624ca76dda Mon Sep 17 00:00:00 2001 From: V-Zabayrachny <79155496+V-Zabayrachny@users.noreply.github.com> Date: Fri, 29 Oct 2021 18:41:09 +0300 Subject: [PATCH] [Ubuntu] fix software report for azure-cli (#4379) --- images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index 79b306cb..e4d65b09 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -196,13 +196,13 @@ function Get-JqVersion { } function Get-AzureCliVersion { - $azcliVersion = az -v | Select-String "azure-cli" | Take-OutputPart -Part -1 + $azcliVersion = (az version | ConvertFrom-Json).'azure-cli' $aptSourceRepo = Get-AptSourceRepository -PackageName "azure-cli" return "Azure CLI (azure-cli) $azcliVersion (installation method: $aptSourceRepo)" } function Get-AzureDevopsVersion { - $azdevopsVersion = az -v | Select-String "azure-devops" | Take-OutputPart -Part -1 + $azdevopsVersion = (az version | ConvertFrom-Json).extensions.'azure-devops' return "Azure CLI (azure-devops) $azdevopsVersion" }