Improve table and tool versions comparison for new Software Report module (#6729)

This commit is contained in:
Maxim Lobanov
2022-12-13 16:54:41 +01:00
committed by GitHub
parent 656d9522e0
commit 6033af8dd1
8 changed files with 120 additions and 135 deletions

View File

@@ -9,8 +9,7 @@ function Get-BashVersion {
function Get-DotnetVersionList {
$sdkRawList = Run-Command "dotnet --list-sdks"
$sdkVersionList = $sdkRawList | ForEach-Object { Take-Part $_ -Part 0 }
return [string]::Join(" ", $sdkVersionList)
return $sdkRawList | ForEach-Object { Take-Part $_ -Part 0 }
}
function Get-GoVersion {
@@ -148,8 +147,7 @@ function Get-NVMNodeVersionList {
$nvmInitCommand = ". ${nvmPath} > /dev/null 2>&1 || true"
$nodejsVersionsRaw = Run-Command "${nvmInitCommand} && nvm ls"
$nodeVersions = $nodejsVersionsRaw | ForEach-Object { $_.TrimStart(" ").TrimEnd(" *") } | Where-Object { $_.StartsWith("v") }
$formattedNodeVersions = $nodeVersions | ForEach-Object { $_.TrimStart("v") }
return [string]::Join(" ", $formattedNodeVersions)
return $nodeVersions | ForEach-Object { $_.TrimStart("v") }
}
function Build-OSInfoSection {
@@ -331,7 +329,7 @@ function Get-PackerVersion {
}
function Get-OpenSSLVersion {
$opensslVersion = Get-Item /usr/local/opt/openssl@1.1 | ForEach-Object {"{0} ``({1} -> {2})``" -f (Run-Command "openssl version"), $_.FullName, $_.Target}
$opensslVersion = Run-Command "openssl version"
return ($opensslVersion -replace "^OpenSSL").Trim()
}