From b23edef7232babfd5857add0c2451034dd74c747 Mon Sep 17 00:00:00 2001 From: Mikhail Koliada <88318005+mikhailkoliada@users.noreply.github.com> Date: Thu, 25 Aug 2022 15:12:31 +0200 Subject: [PATCH] [macOS] Use json to parse libraries version (#6143) --- images/macos/software-report/SoftwareReport.Common.psm1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/images/macos/software-report/SoftwareReport.Common.psm1 b/images/macos/software-report/SoftwareReport.Common.psm1 index ff949b008..22c30c9d4 100644 --- a/images/macos/software-report/SoftwareReport.Common.psm1 +++ b/images/macos/software-report/SoftwareReport.Common.psm1 @@ -524,22 +524,22 @@ function Get-JazzyVersion { } function Get-ZlibVersion { - $zlibVersion = (brew info zlib)[0] | Take-Part -Part 2 + $zlibVersion = brew info --json zlib | jq -r '.[].installed[].version' return "Zlib $zlibVersion" } function Get-LibXftVersion { - $libXftVersion = (brew info libxft)[0] | Take-Part -Part 2 + $libXftVersion = brew info --json libxft | jq -r '.[].installed[].version' return "libXft $libXftVersion" } function Get-LibXextVersion { - $libXextVersion = (brew info libxext)[0] | Take-Part -Part 2 + $libXextVersion = brew info --json libxext | jq -r '.[].installed[].version' return "libXext $libXextVersion" } function Get-TclTkVersion { - $tcltkVersion = (brew info tcl-tk)[0] | Take-Part -Part 2 + $tcltkVersion = brew info --json tcl-tk | jq -r '.[].installed[].version' return "Tcl/Tk $tcltkVersion" }