From b86d5523dd936143ea65269868e95b871c131289 Mon Sep 17 00:00:00 2001 From: Dusko Dobranic <101048884+ddobranic@users.noreply.github.com> Date: Wed, 4 May 2022 17:09:51 +0200 Subject: [PATCH] [Ubuntu] Fix kubectl version report (#5479) --- images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index bcfe1b84a..c8921d10d 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -142,7 +142,7 @@ function Get-KindVersion { } function Get-KubectlVersion { - $kubectlVersion = kubectl version --client --short | Take-OutputPart -Part 2 | Take-OutputPart -Part 0 -Delimiter "v" + $kubectlVersion = (kubectl version --client --output=json | ConvertFrom-Json).clientVersion.gitVersion.Replace('v','') return "Kubectl $kubectlVersion" }