From ad4871d86cbdb95f13e9a5a7f1c146ee1bf80342 Mon Sep 17 00:00:00 2001 From: Dusko Dobranic <101048884+ddobranic@users.noreply.github.com> Date: Thu, 5 May 2022 16:04:43 +0200 Subject: [PATCH] Fix kubectl version in software report (#5491) --- images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 index af06164c4..d14a9adc0 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Tools.psm1 @@ -87,8 +87,7 @@ function Get-JQVersion { } function Get-KubectlVersion { - $(kubectl version --client=true --short=true) -match "Client Version: v(?.+)" | Out-Null - $kubectlVersion = $Matches.Version + $kubectlVersion = (kubectl version --client --output=json | ConvertFrom-Json).clientVersion.gitVersion.Replace('v','') return "Kubectl $kubectlVersion" }