mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-12 12:56:47 +00:00
[Ubuntu] Update documentation generation to use shared software report module (#6823)
* Create ubuntu-report.yml * Update ubuntu-report.yml * Update ubuntu-report.yml * Update Common.Helpers.psm1 * Update ubuntu-report.yml * Update ubuntu-report.yml * Update SoftwareReport.Generator.ps1 * Update ubuntu-report.yml * Update ubuntu-report.yml * env vars * Implement language and runtime * Add package management section * fix typo * fix typo * add projectManagement and tools * fix some tools * add CLI tools, Java, PHP Tools, Haskell Tools, Rust Tools, Browsers, .NET Core * fix typo * more changes * fix typo * fix typo * fix typo * change templates * fix toolset * Update Ubuntu2004 and 2204 templates * fix cargo * fix tiny nitpicks * Fix AddToolVersionsList * Remove unused methods * Fix contructor
This commit is contained in:
@@ -1,66 +1,61 @@
|
|||||||
function Get-ChromeVersion {
|
function Get-ChromeVersion {
|
||||||
$googleChromeVersion = google-chrome --version | Take-OutputPart -Part 2
|
$googleChromeVersion = google-chrome --version | Take-OutputPart -Part 2
|
||||||
return "Google Chrome $googleChromeVersion"
|
return $googleChromeVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-ChromeDriverVersion {
|
function Get-ChromeDriverVersion {
|
||||||
$chromeDriverVersion = chromedriver --version | Take-OutputPart -Part 1
|
$chromeDriverVersion = chromedriver --version | Take-OutputPart -Part 1
|
||||||
return "ChromeDriver $chromeDriverVersion"
|
return $chromeDriverVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-FirefoxVersion {
|
function Get-FirefoxVersion {
|
||||||
$firefoxVersion = firefox --version
|
$firefoxVersion = $(firefox --version) | Take-OutputPart -Part 2
|
||||||
return "$firefoxVersion"
|
return $firefoxVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-GeckodriverVersion {
|
function Get-GeckodriverVersion {
|
||||||
$geckodriverVersion = geckodriver --version | Select-Object -First 1 | Take-OutputPart -Part 1
|
$geckodriverVersion = geckodriver --version | Select-Object -First 1 | Take-OutputPart -Part 1
|
||||||
return "Geckodriver $geckodriverVersion"
|
return $geckodriverVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-ChromiumVersion {
|
function Get-ChromiumVersion {
|
||||||
$chromiumVersion = chromium-browser --version | Take-OutputPart -Part 0,1
|
$chromiumVersion = chromium-browser --version | Take-OutputPart -Part 1
|
||||||
return $chromiumVersion
|
return $chromiumVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-EdgeVersion {
|
function Get-EdgeVersion {
|
||||||
$edgeVersion = (microsoft-edge --version).trim()
|
$edgeVersion = (microsoft-edge --version).Trim() | Take-OutputPart -Part 2
|
||||||
return "$edgeVersion"
|
return $edgeVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-EdgeDriverVersion {
|
function Get-EdgeDriverVersion {
|
||||||
$edgeDriverVersion = msedgedriver --version | Take-OutputPart -Part 0,1,2,3
|
$edgeDriverVersion = msedgedriver --version | Take-OutputPart -Part 3
|
||||||
return $edgeDriverVersion
|
return $edgeDriverVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-SeleniumVersion {
|
function Get-SeleniumVersion {
|
||||||
$seleniumBinaryName = Get-ToolsetValue "selenium.binary_name"
|
$seleniumBinaryName = Get-ToolsetValue "selenium.binary_name"
|
||||||
$fullSeleniumVersion = (Get-ChildItem "/usr/share/java/${seleniumBinaryName}-*").Name -replace "${seleniumBinaryName}-"
|
$fullSeleniumVersion = (Get-ChildItem "/usr/share/java/${seleniumBinaryName}-*").Name -replace "${seleniumBinaryName}-"
|
||||||
return "Selenium server $fullSeleniumVersion"
|
return $fullSeleniumVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Build-BrowserWebdriversEnvironmentTable {
|
function Build-BrowserWebdriversEnvironmentTable {
|
||||||
return @(
|
return @(
|
||||||
@{
|
[PSCustomObject] @{
|
||||||
"Name" = "CHROMEWEBDRIVER"
|
"Name" = "CHROMEWEBDRIVER"
|
||||||
"Value" = $env:CHROMEWEBDRIVER
|
"Value" = $env:CHROMEWEBDRIVER
|
||||||
},
|
},
|
||||||
@{
|
[PSCustomObject] @{
|
||||||
"Name" = "EDGEWEBDRIVER"
|
"Name" = "EDGEWEBDRIVER"
|
||||||
"Value" = $env:EDGEWEBDRIVER
|
"Value" = $env:EDGEWEBDRIVER
|
||||||
},
|
},
|
||||||
@{
|
[PSCustomObject] @{
|
||||||
"Name" = "GECKOWEBDRIVER"
|
"Name" = "GECKOWEBDRIVER"
|
||||||
"Value" = $env:GECKOWEBDRIVER
|
"Value" = $env:GECKOWEBDRIVER
|
||||||
},
|
},
|
||||||
@{
|
[PSCustomObject] @{
|
||||||
"Name" = "SELENIUM_JAR_PATH"
|
"Name" = "SELENIUM_JAR_PATH"
|
||||||
"Value" = $env:SELENIUM_JAR_PATH
|
"Value" = $env:SELENIUM_JAR_PATH
|
||||||
}
|
}
|
||||||
) | ForEach-Object {
|
)
|
||||||
[PSCustomObject] @{
|
|
||||||
"Name" = $_.Name
|
|
||||||
"Value" = $_.Value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,25 +26,4 @@ function Get-ToolcacheNodeVersions {
|
|||||||
function Get-ToolcacheGoVersions {
|
function Get-ToolcacheGoVersions {
|
||||||
$toolcachePath = Join-Path $env:AGENT_TOOLSDIRECTORY "go"
|
$toolcachePath = Join-Path $env:AGENT_TOOLSDIRECTORY "go"
|
||||||
return Get-ChildItem $toolcachePath -Name | Sort-Object { [Version]$_ }
|
return Get-ChildItem $toolcachePath -Name | Sort-Object { [Version]$_ }
|
||||||
}
|
}
|
||||||
|
|
||||||
function Build-CachedToolsSection {
|
|
||||||
$output = ""
|
|
||||||
|
|
||||||
$output += New-MDHeader "Go" -Level 4
|
|
||||||
$output += New-MDList -Lines (Get-ToolcacheGoVersions) -Style Unordered
|
|
||||||
|
|
||||||
$output += New-MDHeader "Node.js" -Level 4
|
|
||||||
$output += New-MDList -Lines (Get-ToolcacheNodeVersions) -Style Unordered
|
|
||||||
|
|
||||||
$output += New-MDHeader "Python" -Level 4
|
|
||||||
$output += New-MDList -Lines (Get-ToolcachePythonVersions) -Style Unordered
|
|
||||||
|
|
||||||
$output += New-MDHeader "PyPy" -Level 4
|
|
||||||
$output += New-MDList -Lines (Get-ToolcachePyPyVersions) -Style Unordered
|
|
||||||
|
|
||||||
$output += New-MDHeader "Ruby" -Level 4
|
|
||||||
$output += New-MDList -Lines (Get-ToolcacheRubyVersions) -Style Unordered
|
|
||||||
|
|
||||||
return $output
|
|
||||||
}
|
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
function Get-BashVersion {
|
function Get-BashVersion {
|
||||||
$version = bash -c 'echo ${BASH_VERSION}'
|
$version = bash -c 'echo ${BASH_VERSION}'
|
||||||
return "Bash $version"
|
return $version
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-DashVersion {
|
function Get-DashVersion {
|
||||||
$version = dpkg-query -W -f '${Version}' dash
|
$version = dpkg-query -W -f '${Version}' dash
|
||||||
return "Dash $version"
|
return $version
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-CPPVersions {
|
function Get-CPPVersions {
|
||||||
@@ -13,7 +13,7 @@ function Get-CPPVersions {
|
|||||||
$cppVersions = $result.Output | Where-Object { $_ -match "g\+\+-\d+"} | ForEach-Object {
|
$cppVersions = $result.Output | Where-Object { $_ -match "g\+\+-\d+"} | ForEach-Object {
|
||||||
& $_.Split("/")[0] --version | Select-Object -First 1 | Take-OutputPart -Part 3
|
& $_.Split("/")[0] --version | Select-Object -First 1 | Take-OutputPart -Part 3
|
||||||
} | Sort-Object {[Version]$_}
|
} | Sort-Object {[Version]$_}
|
||||||
return "GNU C++ " + ($cppVersions -Join ", ")
|
return $cppVersions
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-FortranVersions {
|
function Get-FortranVersions {
|
||||||
@@ -22,7 +22,7 @@ function Get-FortranVersions {
|
|||||||
$_ -match "now (?<version>\d+\.\d+\.\d+)-" | Out-Null
|
$_ -match "now (?<version>\d+\.\d+\.\d+)-" | Out-Null
|
||||||
$Matches.version
|
$Matches.version
|
||||||
} | Sort-Object {[Version]$_}
|
} | Sort-Object {[Version]$_}
|
||||||
return "GNU Fortran " + ($fortranVersions -Join ", ")
|
return $fortranVersions
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-ClangToolVersions {
|
function Get-ClangToolVersions {
|
||||||
@@ -42,199 +42,179 @@ function Get-ClangToolVersions {
|
|||||||
}
|
}
|
||||||
} | Sort-Object {[Version]$_}
|
} | Sort-Object {[Version]$_}
|
||||||
|
|
||||||
return $toolVersions -Join ", "
|
return $toolVersions
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-ClangVersions {
|
|
||||||
$clangVersions = Get-ClangToolVersions -ToolName "clang"
|
|
||||||
return "Clang $clangVersions"
|
|
||||||
}
|
|
||||||
|
|
||||||
function Get-ClangFormatVersions {
|
|
||||||
$clangFormatVersions = Get-ClangToolVersions -ToolName "clang-format"
|
|
||||||
return "Clang-format $clangFormatVersions"
|
|
||||||
}
|
|
||||||
|
|
||||||
function Get-ClangTidyVersions {
|
function Get-ClangTidyVersions {
|
||||||
$clangFormatVersions = Get-ClangToolVersions -ToolName "clang-tidy" -VersionLineMatcher "LLVM version" -VersionPattern "\d+\.\d+\.\d+)"
|
return Get-ClangToolVersions -ToolName "clang-tidy" -VersionLineMatcher "LLVM version" -VersionPattern "\d+\.\d+\.\d+)"
|
||||||
return "Clang-tidy $clangFormatVersions"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function Get-ErlangVersion {
|
function Get-ErlangVersion {
|
||||||
$erlangVersion = (erl -eval '{ok, Version} = file:read_file(filename:join([code:root_dir(), "releases", erlang:system_info(otp_release), ''OTP_VERSION''])), io:fwrite(Version), halt().' -noshell)
|
$erlangVersion = (erl -eval '{ok, Version} = file:read_file(filename:join([code:root_dir(), "releases", erlang:system_info(otp_release), ''OTP_VERSION''])), io:fwrite(Version), halt().' -noshell)
|
||||||
$shellVersion = (erl -eval 'erlang:display(erlang:system_info(version)), halt().' -noshell).Trim('"')
|
$shellVersion = (erl -eval 'erlang:display(erlang:system_info(version)), halt().' -noshell).Trim('"')
|
||||||
return "Erlang $erlangVersion (Eshell $shellVersion)"
|
return "$erlangVersion (Eshell $shellVersion)"
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-ErlangRebar3Version {
|
function Get-ErlangRebar3Version {
|
||||||
$result = Get-CommandResult "rebar3 --version"
|
$result = Get-CommandResult "rebar3 --version"
|
||||||
$result.Output -match "rebar (?<version>(\d+.){2}\d+)" | Out-Null
|
$result.Output -match "rebar (?<version>(\d+.){2}\d+)" | Out-Null
|
||||||
$rebarVersion = $Matches.version
|
return $Matches.version
|
||||||
return "Erlang rebar3 $rebarVersion"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-MonoVersion {
|
function Get-MonoVersion {
|
||||||
$monoVersion = mono --version | Out-String | Take-OutputPart -Part 4
|
$monoVersion = mono --version | Out-String | Take-OutputPart -Part 4
|
||||||
return "Mono $monoVersion"
|
return $monoVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-MsbuildVersion {
|
function Get-MsbuildVersion {
|
||||||
$msbuildVersion = msbuild -version | Select-Object -Last 1
|
$msbuildVersion = msbuild -version | Select-Object -Last 1
|
||||||
$monoVersion = Get-MonoVersion
|
$monoVersion = Get-MonoVersion
|
||||||
return "MSBuild $msbuildVersion ($monoVersion)"
|
return "$msbuildVersion (Mono $monoVersion)"
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-NuGetVersion {
|
function Get-NuGetVersion {
|
||||||
$nugetVersion = nuget help | Select-Object -First 1 | Take-OutputPart -Part 2
|
$nugetVersion = nuget help | Select-Object -First 1 | Take-OutputPart -Part 2
|
||||||
return "NuGet $nugetVersion"
|
return $nugetVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-NodeVersion {
|
function Get-NodeVersion {
|
||||||
$nodeVersion = $(node --version).Substring(1)
|
$nodeVersion = $(node --version).Substring(1)
|
||||||
return "Node $nodeVersion"
|
return $nodeVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-OpensslVersion {
|
function Get-OpensslVersion {
|
||||||
return "OpenSSL $(dpkg-query -W -f '${Version}' openssl)"
|
return $(dpkg-query -W -f '${Version}' openssl)
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-PerlVersion {
|
function Get-PerlVersion {
|
||||||
$version = $(perl -e 'print substr($^V,1)')
|
$version = $(perl -e 'print substr($^V,1)')
|
||||||
return "Perl $version"
|
return $version
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-PythonVersion {
|
function Get-PythonVersion {
|
||||||
$result = Get-CommandResult "python --version"
|
$result = Get-CommandResult "python --version"
|
||||||
$version = $result.Output | Take-OutputPart -Part 1
|
$version = $result.Output | Take-OutputPart -Part 1
|
||||||
return "Python $version"
|
return $version
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-Python3Version {
|
function Get-Python3Version {
|
||||||
$result = Get-CommandResult "python3 --version"
|
$result = Get-CommandResult "python3 --version"
|
||||||
$version = $result.Output | Take-OutputPart -Part 1
|
$version = $result.Output | Take-OutputPart -Part 1
|
||||||
return "Python3 $version"
|
return $version
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-PowershellVersion {
|
function Get-PowershellVersion {
|
||||||
return $(pwsh --version)
|
return $(pwsh --version) | Take-OutputPart -Part 1
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-RubyVersion {
|
function Get-RubyVersion {
|
||||||
$rubyVersion = ruby --version | Out-String | Take-OutputPart -Part 1
|
$rubyVersion = ruby --version | Out-String | Take-OutputPart -Part 1
|
||||||
return "Ruby $rubyVersion"
|
return $rubyVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-SwiftVersion {
|
function Get-SwiftVersion {
|
||||||
$swiftVersion = swift --version | Out-String | Take-OutputPart -Part 2
|
$swiftVersion = swift --version | Out-String | Take-OutputPart -Part 2
|
||||||
return "Swift $swiftVersion"
|
return $swiftVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-KotlinVersion {
|
function Get-KotlinVersion {
|
||||||
$kotlinVersion = kotlin -version | Out-String | Take-OutputPart -Part 2
|
$kotlinVersion = kotlin -version | Out-String | Take-OutputPart -Part 2
|
||||||
return "Kotlin $kotlinVersion"
|
return $kotlinVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-JuliaVersion {
|
function Get-JuliaVersion {
|
||||||
$juliaVersion = julia --version | Take-OutputPart -Part 2
|
$juliaVersion = julia --version | Take-OutputPart -Part 2
|
||||||
return "Julia $juliaVersion"
|
return $juliaVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-LernaVersion {
|
function Get-LernaVersion {
|
||||||
$version = lerna -v
|
$version = lerna -v
|
||||||
return "Lerna $version"
|
return $version
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-HomebrewVersion {
|
function Get-HomebrewVersion {
|
||||||
$result = Get-CommandResult "/home/linuxbrew/.linuxbrew/bin/brew -v"
|
$result = Get-CommandResult "/home/linuxbrew/.linuxbrew/bin/brew -v"
|
||||||
$result.Output -match "Homebrew (?<version>\d+\.\d+\.\d+)" | Out-Null
|
$result.Output -match "Homebrew (?<version>\d+\.\d+\.\d+)" | Out-Null
|
||||||
$version = $Matches.version
|
return $Matches.version
|
||||||
return "Homebrew $version"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-CpanVersion {
|
function Get-CpanVersion {
|
||||||
$result = Get-CommandResult "cpan --version" -ExpectExitCode @(25, 255)
|
$result = Get-CommandResult "cpan --version" -ExpectExitCode @(25, 255)
|
||||||
$result.Output -match "version (?<version>\d+\.\d+) " | Out-Null
|
$result.Output -match "version (?<version>\d+\.\d+) " | Out-Null
|
||||||
$cpanVersion = $Matches.version
|
return $Matches.version
|
||||||
return "cpan $cpanVersion"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-GemVersion {
|
function Get-GemVersion {
|
||||||
$result = Get-CommandResult "gem --version"
|
$result = Get-CommandResult "gem --version"
|
||||||
$result.Output -match "(?<version>\d+\.\d+\.\d+)" | Out-Null
|
$result.Output -match "(?<version>\d+\.\d+\.\d+)" | Out-Null
|
||||||
$gemVersion = $Matches.version
|
return $Matches.version
|
||||||
return "RubyGems $gemVersion"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-MinicondaVersion {
|
function Get-MinicondaVersion {
|
||||||
$condaVersion = conda --version
|
$condaVersion = conda --version | Take-OutputPart -Part 1
|
||||||
return "Mini$condaVersion"
|
return $condaVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-HelmVersion {
|
function Get-HelmVersion {
|
||||||
$(helm version) -match 'Version:"v(?<version>\d+\.\d+\.\d+)"' | Out-Null
|
$(helm version) -match 'Version:"v(?<version>\d+\.\d+\.\d+)"' | Out-Null
|
||||||
$helmVersion = $Matches.version
|
return $Matches.version
|
||||||
return "Helm $helmVersion"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-NpmVersion {
|
function Get-NpmVersion {
|
||||||
$npmVersion = npm --version
|
$npmVersion = npm --version
|
||||||
return "Npm $npmVersion"
|
return $npmVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-YarnVersion {
|
function Get-YarnVersion {
|
||||||
$yarnVersion = yarn --version
|
$yarnVersion = yarn --version
|
||||||
return "Yarn $yarnVersion"
|
return $yarnVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-ParcelVersion {
|
function Get-ParcelVersion {
|
||||||
$parcelVersion = parcel --version
|
$parcelVersion = parcel --version
|
||||||
return "Parcel $parcelVersion"
|
return $parcelVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-PipVersion {
|
function Get-PipVersion {
|
||||||
$result = Get-CommandResult "pip --version"
|
$result = Get-CommandResult "pip --version"
|
||||||
$result.Output -match "pip (?<version>\d+\.\d+\.\d+)" | Out-Null
|
$result.Output -match "pip (?<version>\d+\.\d+\.\d+)" | Out-Null
|
||||||
$pipVersion = $Matches.version
|
return $Matches.version
|
||||||
return "Pip $pipVersion"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-Pip3Version {
|
function Get-Pip3Version {
|
||||||
$result = Get-CommandResult "pip3 --version"
|
$result = Get-CommandResult "pip3 --version"
|
||||||
$result.Output -match "pip (?<version>\d+\.\d+\.\d+)" | Out-Null
|
$result.Output -match "pip (?<version>\d+\.\d+\.\d+)" | Out-Null
|
||||||
$pipVersion = $Matches.version
|
return $Matches.version
|
||||||
return "Pip3 $pipVersion"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-VcpkgVersion {
|
function Get-VcpkgVersion {
|
||||||
$commitId = git -C "/usr/local/share/vcpkg" rev-parse --short HEAD
|
$commitId = git -C "/usr/local/share/vcpkg" rev-parse --short HEAD
|
||||||
return "Vcpkg (build from commit $commitId)"
|
return "(build from commit $commitId)"
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-AntVersion {
|
function Get-AntVersion {
|
||||||
$result = ant -version | Out-String
|
$result = ant -version | Out-String
|
||||||
$result -match "version (?<version>\d+\.\d+\.\d+)" | Out-Null
|
$result -match "version (?<version>\d+\.\d+\.\d+)" | Out-Null
|
||||||
$antVersion = $Matches.version
|
return $Matches.version
|
||||||
return "Ant $antVersion"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-GradleVersion {
|
function Get-GradleVersion {
|
||||||
$gradleVersion = (gradle -v) -match "^Gradle \d" | Take-OutputPart -Part 1
|
$gradleVersion = (gradle -v) -match "^Gradle \d" | Take-OutputPart -Part 1
|
||||||
return "Gradle $gradleVersion"
|
return $gradleVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-MavenVersion {
|
function Get-MavenVersion {
|
||||||
$result = mvn -version | Out-String
|
$result = mvn -version | Out-String
|
||||||
$result -match "Apache Maven (?<version>\d+\.\d+\.\d+)" | Out-Null
|
$result -match "Apache Maven (?<version>\d+\.\d+\.\d+)" | Out-Null
|
||||||
$mavenVersion = $Matches.version
|
return $Matches.version
|
||||||
return "Maven $mavenVersion"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-SbtVersion {
|
function Get-SbtVersion {
|
||||||
$result = Get-CommandResult "sbt -version"
|
$result = Get-CommandResult "sbt -version"
|
||||||
$result.Output -match "sbt script version: (?<version>\d+\.\d+\.\d+)" | Out-Null
|
$result.Output -match "sbt script version: (?<version>\d+\.\d+\.\d+)" | Out-Null
|
||||||
$sbtVersion = $Matches.version
|
return $Matches.version
|
||||||
return "Sbt $sbtVersion"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-PHPVersions {
|
function Get-PHPVersions {
|
||||||
@@ -255,43 +235,24 @@ function Get-PHPUnitVersion {
|
|||||||
return $Matches.version
|
return $Matches.version
|
||||||
}
|
}
|
||||||
|
|
||||||
function Build-PHPSection {
|
|
||||||
$output = ""
|
|
||||||
$output += New-MDHeader "PHP Tools" -Level 3
|
|
||||||
$output += New-MDList -Style Unordered -Lines @(
|
|
||||||
"PHP: $((Get-PHPVersions) -join ', ')",
|
|
||||||
"Composer $(Get-ComposerVersion)",
|
|
||||||
"PHPUnit $(Get-PHPUnitVersion)"
|
|
||||||
)
|
|
||||||
$output += New-MDCode -Lines @(
|
|
||||||
"Both Xdebug and PCOV extensions are installed, but only Xdebug is enabled."
|
|
||||||
)
|
|
||||||
|
|
||||||
return $output
|
|
||||||
}
|
|
||||||
|
|
||||||
function Get-GHCVersion {
|
function Get-GHCVersion {
|
||||||
$(ghc --version) -match "version (?<version>\d+\.\d+\.\d+)" | Out-Null
|
$(ghc --version) -match "version (?<version>\d+\.\d+\.\d+)" | Out-Null
|
||||||
$ghcVersion = $Matches.version
|
return $Matches.version
|
||||||
return "GHC $ghcVersion"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-GHCupVersion {
|
function Get-GHCupVersion {
|
||||||
$(ghcup --version) -match "version v(?<version>\d+(\.\d+){2,})" | Out-Null
|
$(ghcup --version) -match "version v(?<version>\d+(\.\d+){2,})" | Out-Null
|
||||||
$ghcVersion = $Matches.version
|
return $Matches.version
|
||||||
return "GHCup $ghcVersion"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-CabalVersion {
|
function Get-CabalVersion {
|
||||||
$(cabal --version | Out-String) -match "cabal-install version (?<version>\d+\.\d+\.\d+\.\d+)" | Out-Null
|
$(cabal --version | Out-String) -match "cabal-install version (?<version>\d+\.\d+\.\d+\.\d+)" | Out-Null
|
||||||
$cabalVersion = $Matches.version
|
return $Matches.version
|
||||||
return "Cabal $cabalVersion"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-StackVersion {
|
function Get-StackVersion {
|
||||||
$(stack --version | Out-String) -match "Version (?<version>\d+\.\d+\.\d+)" | Out-Null
|
$(stack --version | Out-String) -match "Version (?<version>\d+\.\d+\.\d+)" | Out-Null
|
||||||
$stackVersion = $Matches.version
|
return $Matches.version
|
||||||
return "Stack $stackVersion"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-AzModuleVersions {
|
function Get-AzModuleVersions {
|
||||||
@@ -308,41 +269,36 @@ function Get-PowerShellModules {
|
|||||||
|
|
||||||
[Array] $azureInstalledModules = Get-ChildItem -Path "/usr/share/az_*" -Directory | ForEach-Object { $_.Name.Split("_")[1] }
|
[Array] $azureInstalledModules = Get-ChildItem -Path "/usr/share/az_*" -Directory | ForEach-Object { $_.Name.Split("_")[1] }
|
||||||
if ($azureInstalledModules.Count -gt 0) {
|
if ($azureInstalledModules.Count -gt 0) {
|
||||||
$result += "Az: $($azureInstalledModules -join ', ')"
|
$result += [ToolVersionsListNode]::new("Az", $azureInstalledModules, "^\d+\.\d+", "Inline")
|
||||||
}
|
}
|
||||||
|
|
||||||
[Array] $azureCachedModules = Get-ChildItem /usr/share/az_*.zip -File | ForEach-Object { $_.Name.Split("_")[1] }
|
[Array] $azureCachedModules = Get-ChildItem /usr/share/az_*.zip -File | ForEach-Object { $_.Name.Split("_")[1] }
|
||||||
if ($azureCachedModules.Count -gt 0) {
|
if ($azureCachedModules.Count -gt 0) {
|
||||||
$result += "Az (Cached): $($azureCachedModules -join ', ')"
|
$result += [ToolVersionsListNode]::new("Az (Cached)", $azureCachedModules, "^\d+\.\d+", "Inline")
|
||||||
}
|
}
|
||||||
|
|
||||||
$result += (Get-ToolsetContent).powershellModules.name | ForEach-Object {
|
(Get-ToolsetContent).powershellModules.name | ForEach-Object {
|
||||||
$moduleName = $_
|
$moduleName = $_
|
||||||
$moduleVersions = Get-Module -Name $moduleName -ListAvailable | Select-Object -ExpandProperty Version | Sort-Object -Unique
|
$moduleVersions = Get-Module -Name $moduleName -ListAvailable | Select-Object -ExpandProperty Version | Sort-Object -Unique
|
||||||
return "$($moduleName): $($moduleVersions -join ', ')"
|
$result += [ToolVersionsListNode]::new($moduleName, $moduleVersions, "^\d+", "Inline")
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result
|
return $result
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-DotNetCoreSdkVersions {
|
function Get-DotNetCoreSdkVersions {
|
||||||
$unsortedDotNetCoreSdkVersion = dotnet --list-sdks list | ForEach-Object { $_ | Take-OutputPart -Part 0 }
|
$dotNetCoreSdkVersion = dotnet --list-sdks list | ForEach-Object { $_ | Take-OutputPart -Part 0 }
|
||||||
$dotNetCoreSdkVersion = $unsortedDotNetCoreSdkVersion -join ", "
|
|
||||||
return $dotNetCoreSdkVersion
|
return $dotNetCoreSdkVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-DotnetTools {
|
function Get-DotnetTools {
|
||||||
$env:PATH = "/etc/skel/.dotnet/tools:$($env:PATH)"
|
$env:PATH = "/etc/skel/.dotnet/tools:$($env:PATH)"
|
||||||
|
|
||||||
$dotnetTools = (Get-ToolsetContent).dotnet.tools
|
$dotnetTools = (Get-ToolsetContent).dotnet.tools
|
||||||
|
|
||||||
$toolsList = @()
|
return $dotnetTools | ForEach-Object {
|
||||||
|
$version = Invoke-Expression $_.getversion
|
||||||
ForEach ($dotnetTool in $dotnetTools) {
|
return [ToolVersionNode]::new($_.name, $version)
|
||||||
$toolsList += $dotnetTool.name + " " + (Invoke-Expression $dotnetTool.getversion)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $toolsList
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-CachedDockerImages {
|
function Get-CachedDockerImages {
|
||||||
@@ -385,8 +341,7 @@ function Get-AptPackages {
|
|||||||
function Get-PipxVersion {
|
function Get-PipxVersion {
|
||||||
$result = (Get-CommandResult "pipx --version").Output
|
$result = (Get-CommandResult "pipx --version").Output
|
||||||
$result -match "(?<version>\d+\.\d+\.\d+\.?\d*)" | Out-Null
|
$result -match "(?<version>\d+\.\d+\.\d+\.?\d*)" | Out-Null
|
||||||
$pipxVersion = $Matches.Version
|
return $Matches.Version
|
||||||
return "Pipx $pipxVersion"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-GraalVMVersion {
|
function Get-GraalVMVersion {
|
||||||
@@ -406,18 +361,13 @@ function Build-GraalVMTable {
|
|||||||
|
|
||||||
function Build-PackageManagementEnvironmentTable {
|
function Build-PackageManagementEnvironmentTable {
|
||||||
return @(
|
return @(
|
||||||
@{
|
[PSCustomObject] @{
|
||||||
"Name" = "CONDA"
|
"Name" = "CONDA"
|
||||||
"Value" = $env:CONDA
|
"Value" = $env:CONDA
|
||||||
},
|
},
|
||||||
@{
|
[PSCustomObject] @{
|
||||||
"Name" = "VCPKG_INSTALLATION_ROOT"
|
"Name" = "VCPKG_INSTALLATION_ROOT"
|
||||||
"Value" = $env:VCPKG_INSTALLATION_ROOT
|
"Value" = $env:VCPKG_INSTALLATION_ROOT
|
||||||
}
|
}
|
||||||
) | ForEach-Object {
|
)
|
||||||
[PSCustomObject] @{
|
|
||||||
"Name" = $_.Name
|
|
||||||
"Value" = $_.Value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
function Get-PostgreSqlVersion {
|
function Get-PostgreSqlVersion {
|
||||||
$postgreSQLVersion = psql --version | Take-OutputPart -Part 2
|
$postgreSQLVersion = psql --version | Take-OutputPart -Part 2
|
||||||
return "PostgreSQL $postgreSQLVersion"
|
return $postgreSQLVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-MongoDbVersion {
|
function Get-MongoDbVersion {
|
||||||
$mongoDBVersion = mongod --version | Select-Object -First 1 | Take-OutputPart -Part 2 -Delimiter "v"
|
$mongoDBVersion = mongod --version | Select-Object -First 1 | Take-OutputPart -Part 2 -Delimiter "v"
|
||||||
return "MongoDB $mongoDBVersion"
|
return $mongoDBVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-SqliteVersion {
|
function Get-SqliteVersion {
|
||||||
$sqliteVersion = sqlite3 --version | Take-OutputPart -Part 0
|
$sqliteVersion = sqlite3 --version | Take-OutputPart -Part 0
|
||||||
return "sqlite3 $sqliteVersion"
|
return $sqliteVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-MySQLVersion {
|
function Get-MySQLVersion {
|
||||||
@@ -18,60 +18,47 @@ function Get-MySQLVersion {
|
|||||||
if (Test-IsUbuntu18) {
|
if (Test-IsUbuntu18) {
|
||||||
$mySQLVersion = $mySQLVersion | Take-OutputPart -Part 0 -Delimiter "-"
|
$mySQLVersion = $mySQLVersion | Take-OutputPart -Part 0 -Delimiter "-"
|
||||||
}
|
}
|
||||||
return "MySQL $mySQLVersion"
|
return $mySQLVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-SQLCmdVersion {
|
function Get-SQLCmdVersion {
|
||||||
$sqlcmdVersion = sqlcmd -? | Select-String -Pattern "Version" | Take-OutputPart -Part 1
|
$sqlcmdVersion = sqlcmd -? | Select-String -Pattern "Version" | Take-OutputPart -Part 1
|
||||||
return "sqlcmd $sqlcmdVersion"
|
return $sqlcmdVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-SqlPackageVersion {
|
function Get-SqlPackageVersion {
|
||||||
$sqlPackageVersion = sqlpackage /version
|
$sqlPackageVersion = sqlpackage /version
|
||||||
return "SqlPackage $sqlPackageVersion"
|
return $sqlPackageVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Build-PostgreSqlSection {
|
function Build-PostgreSqlSection {
|
||||||
$output = ""
|
$node = [HeaderNode]::new("PostgreSQL")
|
||||||
|
$node.AddToolVersion("PostgreSQL", $(Get-PostgreSqlVersion))
|
||||||
$output += New-MDHeader "PostgreSQL" -Level 4
|
$node.AddNote(@(
|
||||||
$output += New-MDList -Style Unordered -Lines @(
|
|
||||||
(Get-PostgreSqlVersion)
|
|
||||||
)
|
|
||||||
$output += New-MDCode -Lines @(
|
|
||||||
"User: postgres",
|
"User: postgres",
|
||||||
"PostgreSQL service is disabled by default.",
|
"PostgreSQL service is disabled by default.",
|
||||||
"Use the following command as a part of your job to start the service: 'sudo systemctl start postgresql.service'"
|
"Use the following command as a part of your job to start the service: 'sudo systemctl start postgresql.service'"
|
||||||
)
|
) -join "`n")
|
||||||
|
|
||||||
return $output
|
return $node
|
||||||
}
|
}
|
||||||
|
|
||||||
function Build-MySQLSection {
|
function Build-MySQLSection {
|
||||||
$output = ""
|
$node = [HeaderNode]::new("MySQL")
|
||||||
|
$node.AddToolVersion("MySQL", $(Get-MySQLVersion))
|
||||||
$output += New-MDHeader "MySQL" -Level 4
|
$node.AddNote(@(
|
||||||
$output += New-MDList -Style Unordered -Lines @(
|
|
||||||
(Get-MySQLVersion )
|
|
||||||
)
|
|
||||||
$output += New-MDCode -Lines @(
|
|
||||||
"User: root",
|
"User: root",
|
||||||
"Password: root",
|
"Password: root",
|
||||||
"MySQL service is disabled by default.",
|
"MySQL service is disabled by default.",
|
||||||
"Use the following command as a part of your job to start the service: 'sudo systemctl start mysql.service'"
|
"Use the following command as a part of your job to start the service: 'sudo systemctl start mysql.service'"
|
||||||
)
|
) -join "`n")
|
||||||
|
|
||||||
return $output
|
return $node
|
||||||
}
|
}
|
||||||
|
|
||||||
function Build-MSSQLToolsSection {
|
function Build-MSSQLToolsSection {
|
||||||
$output = ""
|
$node = [HeaderNode]::new("MS SQL")
|
||||||
|
$node.AddToolVersion("sqlcmd", $(Get-SQLCmdVersion))
|
||||||
$output += New-MDHeader "MS SQL Server Client Tools" -Level 4
|
$node.AddToolVersion("SqlPackage", $(Get-SqlPackageVersion))
|
||||||
$output += New-MDList -Style Unordered -Lines @(
|
return $node
|
||||||
(Get-SQLCmdVersion),
|
|
||||||
(Get-SqlPackageVersion)
|
|
||||||
)
|
|
||||||
|
|
||||||
return $output
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
using module ./software-report-base/SoftwareReport.psm1
|
||||||
|
using module ./software-report-base/SoftwareReport.Nodes.psm1
|
||||||
|
|
||||||
param (
|
param (
|
||||||
[Parameter(Mandatory)][string]
|
[Parameter(Mandatory)][string]
|
||||||
$OutputDirectory
|
$OutputDirectory
|
||||||
@@ -7,7 +10,6 @@ $global:ErrorActionPreference = "Stop"
|
|||||||
$global:ErrorView = "NormalView"
|
$global:ErrorView = "NormalView"
|
||||||
Set-StrictMode -Version Latest
|
Set-StrictMode -Version Latest
|
||||||
|
|
||||||
Import-Module MarkdownPS
|
|
||||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Android.psm1") -DisableNameChecking
|
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Android.psm1") -DisableNameChecking
|
||||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Browsers.psm1") -DisableNameChecking
|
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.Browsers.psm1") -DisableNameChecking
|
||||||
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.CachedTools.psm1") -DisableNameChecking
|
Import-Module (Join-Path $PSScriptRoot "SoftwareReport.CachedTools.psm1") -DisableNameChecking
|
||||||
@@ -23,285 +25,221 @@ Import-Module (Join-Path $PSScriptRoot "SoftwareReport.WebServers.psm1") -Disabl
|
|||||||
# Restore file owner in user profile
|
# Restore file owner in user profile
|
||||||
Restore-UserOwner
|
Restore-UserOwner
|
||||||
|
|
||||||
$markdown = ""
|
# Software report
|
||||||
$markdown += New-MDHeader "Ubuntu $(Get-OSVersionShort)" -Level 1
|
$softwareReport = [SoftwareReport]::new("Ubuntu $(Get-OSVersionShort)")
|
||||||
|
$softwareReport.Root.AddToolVersion("OS Version:", $(Get-OSVersionFull))
|
||||||
|
$softwareReport.Root.AddToolVersion("Kernel Version:", $(Get-KernelVersion))
|
||||||
|
$softwareReport.Root.AddToolVersion("Image Version:", $env:IMAGE_VERSION)
|
||||||
|
|
||||||
$markdown += New-MDList -Style Unordered -Lines @(
|
$installedSoftware = $softwareReport.Root.AddHeader("Installed Software")
|
||||||
"OS Version: $(Get-OSVersionFull)"
|
|
||||||
"Kernel Version: $(Get-KernelVersion)"
|
|
||||||
"Image Version: $env:IMAGE_VERSION"
|
|
||||||
)
|
|
||||||
|
|
||||||
$markdown += New-MDHeader "Installed Software" -Level 2
|
|
||||||
$markdown += New-MDHeader "Language and Runtime" -Level 3
|
|
||||||
|
|
||||||
$runtimesList = @(
|
|
||||||
(Get-BashVersion),
|
|
||||||
(Get-DashVersion),
|
|
||||||
(Get-CPPVersions),
|
|
||||||
(Get-FortranVersions),
|
|
||||||
(Get-MsbuildVersion),
|
|
||||||
(Get-MonoVersion),
|
|
||||||
(Get-NodeVersion),
|
|
||||||
(Get-PerlVersion),
|
|
||||||
(Get-PythonVersion),
|
|
||||||
(Get-Python3Version),
|
|
||||||
(Get-RubyVersion),
|
|
||||||
(Get-JuliaVersion),
|
|
||||||
(Get-ClangVersions),
|
|
||||||
(Get-ClangFormatVersions),
|
|
||||||
(Get-ClangTidyVersions),
|
|
||||||
(Get-KotlinVersion),
|
|
||||||
(Get-SwiftVersion)
|
|
||||||
)
|
|
||||||
|
|
||||||
|
# Language and Runtime
|
||||||
|
$languageAndRuntime = $installedSoftware.AddHeader("Language and Runtime")
|
||||||
|
$languageAndRuntime.AddToolVersion("Bash", $(Get-BashVersion))
|
||||||
|
$languageAndRuntime.AddToolVersionsListInline("Clang", $(Get-ClangToolVersions -ToolName "clang"), "^\d+")
|
||||||
|
$languageAndRuntime.AddToolVersionsListInline("Clang-format", $(Get-ClangToolVersions -ToolName "clang-format"), "^\d+")
|
||||||
|
$languageAndRuntime.AddToolVersionsListInline("Clang-tidy", $(Get-ClangTidyVersions), "^\d+")
|
||||||
|
$languageAndRuntime.AddToolVersion("Dash", $(Get-DashVersion))
|
||||||
if ((Test-IsUbuntu18) -or (Test-IsUbuntu20)) {
|
if ((Test-IsUbuntu18) -or (Test-IsUbuntu20)) {
|
||||||
$runtimesList += @(
|
$languageAndRuntime.AddToolVersion("Erlang", $(Get-ErlangVersion))
|
||||||
(Get-ErlangVersion),
|
$languageAndRuntime.AddToolVersion("Erlang rebar3", $(Get-ErlangRebar3Version))
|
||||||
(Get-ErlangRebar3Version)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
$languageAndRuntime.AddToolVersionsListInline("GNU C++", $(Get-CPPVersions), "^\d+")
|
||||||
|
$languageAndRuntime.AddToolVersionsListInline("GNU Fortran", $(Get-FortranVersions), "^\d+")
|
||||||
|
$languageAndRuntime.AddToolVersion("Julia", $(Get-JuliaVersion))
|
||||||
|
$languageAndRuntime.AddToolVersion("Kotlin", $(Get-KotlinVersion))
|
||||||
|
$languageAndRuntime.AddToolVersion("Mono", $(Get-MonoVersion))
|
||||||
|
$languageAndRuntime.AddToolVersion("MSBuild", $(Get-MsbuildVersion))
|
||||||
|
$languageAndRuntime.AddToolVersion("Node.js", $(Get-NodeVersion))
|
||||||
|
$languageAndRuntime.AddToolVersion("Perl", $(Get-PerlVersion))
|
||||||
|
$languageAndRuntime.AddToolVersion("Python", $(Get-PythonVersion))
|
||||||
|
$languageAndRuntime.AddToolVersion("Python3", $(Get-Python3Version))
|
||||||
|
$languageAndRuntime.AddToolVersion("Ruby", $(Get-RubyVersion))
|
||||||
|
$languageAndRuntime.AddToolVersion("Swift", $(Get-SwiftVersion))
|
||||||
|
|
||||||
$markdown += New-MDList -Style Unordered -Lines ($runtimesList | Sort-Object)
|
# Package Management
|
||||||
|
$packageManagement = $installedSoftware.AddHeader("Package Management")
|
||||||
$markdown += New-MDHeader "Package Management" -Level 3
|
$packageManagement.AddToolVersion("cpan", $(Get-CpanVersion))
|
||||||
|
$packageManagement.AddToolVersion("Helm", $(Get-HelmVersion))
|
||||||
$packageManagementList = @(
|
$packageManagement.AddToolVersion("Homebrew", $(Get-HomebrewVersion))
|
||||||
(Get-HomebrewVersion),
|
$packageManagement.AddToolVersion("Miniconda", $(Get-MinicondaVersion))
|
||||||
(Get-CpanVersion),
|
$packageManagement.AddToolVersion("Npm", $(Get-NpmVersion))
|
||||||
(Get-GemVersion),
|
$packageManagement.AddToolVersion("NuGet", $(Get-NuGetVersion))
|
||||||
(Get-MinicondaVersion),
|
$packageManagement.AddToolVersion("Pip", $(Get-PipVersion))
|
||||||
(Get-NuGetVersion),
|
$packageManagement.AddToolVersion("Pip3", $(Get-Pip3Version))
|
||||||
(Get-HelmVersion),
|
$packageManagement.AddToolVersion("Pipx", $(Get-PipxVersion))
|
||||||
(Get-NpmVersion),
|
$packageManagement.AddToolVersion("RubyGems", $(Get-GemVersion))
|
||||||
(Get-YarnVersion),
|
$packageManagement.AddToolVersion("Vcpkg", $(Get-VcpkgVersion))
|
||||||
(Get-PipxVersion),
|
$packageManagement.AddToolVersion("Yarn", $(Get-YarnVersion))
|
||||||
(Get-PipVersion),
|
$packageManagement.AddHeader("Environment variables").AddTable($(Build-PackageManagementEnvironmentTable))
|
||||||
(Get-Pip3Version),
|
$packageManagement.AddHeader("Homebrew note").AddNote(@'
|
||||||
(Get-VcpkgVersion)
|
|
||||||
)
|
|
||||||
|
|
||||||
$markdown += New-MDList -Style Unordered -Lines ($packageManagementList | Sort-Object)
|
|
||||||
|
|
||||||
$markdown += New-MDHeader "Environment variables" -Level 4
|
|
||||||
$markdown += Build-PackageManagementEnvironmentTable | New-MDTable
|
|
||||||
$markdown += New-MDNewLine
|
|
||||||
|
|
||||||
$markdown += New-MDHeader "Homebrew note" -Level 4
|
|
||||||
$reportHomebrew = @'
|
|
||||||
```
|
|
||||||
Location: /home/linuxbrew
|
Location: /home/linuxbrew
|
||||||
Note: Homebrew is pre-installed on image but not added to PATH.
|
Note: Homebrew is pre-installed on image but not added to PATH.
|
||||||
run the eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" command
|
run the eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" command
|
||||||
to accomplish this.
|
to accomplish this.
|
||||||
```
|
'@)
|
||||||
'@
|
|
||||||
$markdown += New-MDParagraph -Lines $reportHomebrew
|
|
||||||
|
|
||||||
$markdown += New-MDHeader "Project Management" -Level 3
|
# Project Management
|
||||||
$projectManagementList = @()
|
$projectManagement = $installedSoftware.AddHeader("Project Management")
|
||||||
if ((Test-IsUbuntu18) -or (Test-IsUbuntu20)) {
|
if ((Test-IsUbuntu18) -or (Test-IsUbuntu20)) {
|
||||||
$projectManagementList += @(
|
$projectManagement.AddToolVersion("Ant", $(Get-AntVersion))
|
||||||
(Get-AntVersion),
|
$projectManagement.AddToolVersion("Gradle", $(Get-GradleVersion))
|
||||||
(Get-GradleVersion),
|
|
||||||
(Get-MavenVersion),
|
|
||||||
(Get-SbtVersion)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Test-IsUbuntu20) -or (Test-IsUbuntu22)) {
|
if ((Test-IsUbuntu20) -or (Test-IsUbuntu22)) {
|
||||||
$projectManagementList += @(
|
$projectManagement.AddToolVersion("Lerna", $(Get-LernaVersion))
|
||||||
(Get-LernaVersion)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
$markdown += New-MDList -Style Unordered -Lines ($projectManagementList | Sort-Object)
|
|
||||||
|
|
||||||
$markdown += New-MDHeader "Tools" -Level 3
|
|
||||||
$toolsList = @(
|
|
||||||
(Get-AnsibleVersion),
|
|
||||||
(Get-AptFastVersion),
|
|
||||||
(Get-AzCopyVersion),
|
|
||||||
(Get-BazelVersion),
|
|
||||||
(Get-BazeliskVersion),
|
|
||||||
(Get-BicepVersion),
|
|
||||||
(Get-CodeQLBundleVersion),
|
|
||||||
(Get-CMakeVersion),
|
|
||||||
(Get-DockerMobyClientVersion),
|
|
||||||
(Get-DockerMobyServerVersion),
|
|
||||||
(Get-DockerComposeV1Version),
|
|
||||||
(Get-DockerComposeV2Version),
|
|
||||||
(Get-DockerBuildxVersion),
|
|
||||||
(Get-DockerAmazonECRCredHelperVersion),
|
|
||||||
(Get-BuildahVersion),
|
|
||||||
(Get-PodManVersion),
|
|
||||||
(Get-SkopeoVersion),
|
|
||||||
(Get-GitVersion),
|
|
||||||
(Get-GitLFSVersion),
|
|
||||||
(Get-GitFTPVersion),
|
|
||||||
(Get-HavegedVersion),
|
|
||||||
(Get-HerokuVersion),
|
|
||||||
(Get-LeiningenVersion),
|
|
||||||
(Get-SVNVersion),
|
|
||||||
(Get-JqVersion),
|
|
||||||
(Get-YqVersion),
|
|
||||||
(Get-KindVersion),
|
|
||||||
(Get-KubectlVersion),
|
|
||||||
(Get-KustomizeVersion),
|
|
||||||
(Get-MediainfoVersion),
|
|
||||||
(Get-HGVersion),
|
|
||||||
(Get-MinikubeVersion),
|
|
||||||
(Get-NewmanVersion),
|
|
||||||
(Get-NVersion),
|
|
||||||
(Get-NvmVersion),
|
|
||||||
(Get-OpensslVersion),
|
|
||||||
(Get-PackerVersion),
|
|
||||||
(Get-ParcelVersion),
|
|
||||||
(Get-PulumiVersion),
|
|
||||||
(Get-RVersion),
|
|
||||||
(Get-SphinxVersion),
|
|
||||||
(Get-TerraformVersion),
|
|
||||||
(Get-YamllintVersion),
|
|
||||||
(Get-ZstdVersion)
|
|
||||||
)
|
|
||||||
|
|
||||||
if ((Test-IsUbuntu18) -or (Test-IsUbuntu20)) {
|
if ((Test-IsUbuntu18) -or (Test-IsUbuntu20)) {
|
||||||
$toolsList += @(
|
$projectManagement.AddToolVersion("Maven", $(Get-MavenVersion))
|
||||||
(Get-PhantomJSVersion),
|
$projectManagement.AddToolVersion("Sbt", $(Get-SbtVersion))
|
||||||
(Get-HHVMVersion)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Tools
|
||||||
|
$tools = $installedSoftware.AddHeader("Tools")
|
||||||
|
$tools.AddToolVersion("Ansible", $(Get-AnsibleVersion))
|
||||||
|
$tools.AddToolVersion("apt-fast", $(Get-AptFastVersion))
|
||||||
|
$tools.AddToolVersion("AzCopy", $(Get-AzCopyVersion))
|
||||||
|
$tools.AddToolVersion("Bazel", $(Get-BazelVersion))
|
||||||
|
$tools.AddToolVersion("Bazelisk", $(Get-BazeliskVersion))
|
||||||
|
$tools.AddToolVersion("Bicep", $(Get-BicepVersion))
|
||||||
|
$tools.AddToolVersion("Buildah", $(Get-BuildahVersion))
|
||||||
|
$tools.AddToolVersion("CMake", $(Get-CMakeVersion))
|
||||||
|
$tools.AddToolVersion("CodeQL Action Bundle", $(Get-CodeQLBundleVersion))
|
||||||
|
$tools.AddToolVersion("Docker Amazon ECR Credential Helper", $(Get-DockerAmazonECRCredHelperVersion))
|
||||||
|
$tools.AddToolVersion("Docker Compose v1", $(Get-DockerComposeV1Version))
|
||||||
|
$tools.AddToolVersion("Docker Compose v2", $(Get-DockerComposeV2Version))
|
||||||
|
$tools.AddToolVersion("Docker-Buildx", $(Get-DockerBuildxVersion))
|
||||||
|
$tools.AddToolVersion("Docker-Moby Client", $(Get-DockerMobyClientVersion))
|
||||||
|
$tools.AddToolVersion("Docker-Moby Server", $(Get-DockerMobyServerVersion))
|
||||||
if ((Test-IsUbuntu20) -or (Test-IsUbuntu22)) {
|
if ((Test-IsUbuntu20) -or (Test-IsUbuntu22)) {
|
||||||
$toolsList += (Get-FastlaneVersion)
|
$tools.AddToolVersion("Fastlane", $(Get-FastlaneVersion))
|
||||||
}
|
}
|
||||||
|
$tools.AddToolVersion("Git", $(Get-GitVersion))
|
||||||
$markdown += New-MDList -Style Unordered -Lines ($toolsList | Sort-Object)
|
$tools.AddToolVersion("Git LFS", $(Get-GitLFSVersion))
|
||||||
|
$tools.AddToolVersion("Git-ftp", $(Get-GitFTPVersion))
|
||||||
$markdown += New-MDHeader "CLI Tools" -Level 3
|
$tools.AddToolVersion("Haveged", $(Get-HavegedVersion))
|
||||||
$markdown += New-MDList -Style Unordered -Lines (@(
|
$tools.AddToolVersion("Heroku", $(Get-HerokuVersion))
|
||||||
(Get-AlibabaCloudCliVersion),
|
|
||||||
(Get-AWSCliVersion),
|
|
||||||
(Get-AWSCliSessionManagerPluginVersion),
|
|
||||||
(Get-AWSSAMVersion),
|
|
||||||
(Get-AzureCliVersion),
|
|
||||||
(Get-AzureDevopsVersion),
|
|
||||||
(Get-GitHubCliVersion),
|
|
||||||
(Get-GoogleCloudSDKVersion),
|
|
||||||
(Get-HubCliVersion),
|
|
||||||
(Get-NetlifyCliVersion),
|
|
||||||
(Get-OCCliVersion),
|
|
||||||
(Get-ORASCliVersion),
|
|
||||||
(Get-VerselCliversion)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
$markdown += New-MDHeader "Java" -Level 3
|
|
||||||
$markdown += Get-JavaVersions | New-MDTable
|
|
||||||
$markdown += New-MDNewLine
|
|
||||||
|
|
||||||
if ((Test-IsUbuntu20) -or (Test-IsUbuntu22)) {
|
|
||||||
$markdown += New-MDHeader "GraalVM" -Level 3
|
|
||||||
$markdown += Build-GraalVMTable | New-MDTable
|
|
||||||
$markdown += New-MDNewLine
|
|
||||||
}
|
|
||||||
|
|
||||||
$markdown += Build-PHPSection
|
|
||||||
|
|
||||||
$markdown += New-MDHeader "Haskell" -Level 3
|
|
||||||
$markdown += New-MDList -Style Unordered -Lines (@(
|
|
||||||
(Get-GHCVersion),
|
|
||||||
(Get-GHCupVersion),
|
|
||||||
(Get-CabalVersion),
|
|
||||||
(Get-StackVersion)
|
|
||||||
) | Sort-Object
|
|
||||||
)
|
|
||||||
|
|
||||||
$markdown += New-MDHeader "Rust Tools" -Level 3
|
|
||||||
$markdown += New-MDList -Style Unordered -Lines (@(
|
|
||||||
(Get-RustVersion),
|
|
||||||
(Get-RustupVersion),
|
|
||||||
(Get-RustdocVersion),
|
|
||||||
(Get-CargoVersion)
|
|
||||||
) | Sort-Object
|
|
||||||
)
|
|
||||||
|
|
||||||
$markdown += New-MDHeader "Packages" -Level 4
|
|
||||||
$markdown += New-MDList -Style Unordered -Lines (@(
|
|
||||||
(Get-BindgenVersion),
|
|
||||||
(Get-CargoAuditVersion),
|
|
||||||
(Get-CargoOutdatedVersion),
|
|
||||||
(Get-CargoClippyVersion),
|
|
||||||
(Get-CbindgenVersion),
|
|
||||||
(Get-RustfmtVersion)
|
|
||||||
) | Sort-Object
|
|
||||||
)
|
|
||||||
|
|
||||||
$markdown += New-MDHeader "Browsers and Drivers" -Level 3
|
|
||||||
|
|
||||||
$browsersAndDriversList = @(
|
|
||||||
(Get-ChromeVersion),
|
|
||||||
(Get-ChromeDriverVersion),
|
|
||||||
(Get-ChromiumVersion),
|
|
||||||
(Get-EdgeVersion),
|
|
||||||
(Get-EdgeDriverVersion),
|
|
||||||
(Get-SeleniumVersion),
|
|
||||||
(Get-FirefoxVersion),
|
|
||||||
(Get-GeckodriverVersion)
|
|
||||||
)
|
|
||||||
|
|
||||||
$markdown += New-MDList -Style Unordered -Lines $browsersAndDriversList
|
|
||||||
$markdown += New-MDHeader "Environment variables" -Level 4
|
|
||||||
$markdown += Build-BrowserWebdriversEnvironmentTable | New-MDTable
|
|
||||||
$markdown += New-MDNewLine
|
|
||||||
|
|
||||||
$markdown += New-MDHeader ".NET Core Tools" -Level 3
|
|
||||||
$netCoreTools = @(
|
|
||||||
".NET Core SDK: $(Get-DotNetCoreSdkVersions)"
|
|
||||||
)
|
|
||||||
$netCoreTools += Get-DotnetTools
|
|
||||||
$markdown += New-MDList -Style Unordered -Lines $netCoreTools
|
|
||||||
|
|
||||||
$markdown += New-MDHeader "Databases" -Level 3
|
|
||||||
$databaseLists = @(
|
|
||||||
(Get-SqliteVersion)
|
|
||||||
)
|
|
||||||
|
|
||||||
if ((Test-IsUbuntu18) -or (Test-IsUbuntu20)) {
|
if ((Test-IsUbuntu18) -or (Test-IsUbuntu20)) {
|
||||||
$databaseLists += @(
|
$tools.AddToolVersion("HHVM (HipHop VM)", $(Get-HHVMVersion))
|
||||||
(Get-MongoDbVersion)
|
}
|
||||||
)
|
$tools.AddToolVersion("jq", $(Get-JqVersion))
|
||||||
|
$tools.AddToolVersion("Kind", $(Get-KindVersion))
|
||||||
|
$tools.AddToolVersion("Kubectl", $(Get-KubectlVersion))
|
||||||
|
$tools.AddToolVersion("Kustomize", $(Get-KustomizeVersion))
|
||||||
|
$tools.AddToolVersion("Leiningen", $(Get-LeiningenVersion))
|
||||||
|
$tools.AddToolVersion("MediaInfo", $(Get-MediainfoVersion))
|
||||||
|
$tools.AddToolVersion("Mercurial", $(Get-HGVersion))
|
||||||
|
$tools.AddToolVersion("Minikube", $(Get-MinikubeVersion))
|
||||||
|
$tools.AddToolVersion("n", $(Get-NVersion))
|
||||||
|
$tools.AddToolVersion("Newman", $(Get-NewmanVersion))
|
||||||
|
$tools.AddToolVersion("nvm", $(Get-NvmVersion))
|
||||||
|
$tools.AddToolVersion("OpenSSL", $(Get-OpensslVersion))
|
||||||
|
$tools.AddToolVersion("Packer", $(Get-PackerVersion))
|
||||||
|
$tools.AddToolVersion("Parcel", $(Get-ParcelVersion))
|
||||||
|
if ((Test-IsUbuntu18) -or (Test-IsUbuntu20)) {
|
||||||
|
$tools.AddToolVersion("PhantomJS", $(Get-PhantomJSVersion))
|
||||||
|
}
|
||||||
|
$tools.AddToolVersion("Podman", $(Get-PodManVersion))
|
||||||
|
$tools.AddToolVersion("Pulumi", $(Get-PulumiVersion))
|
||||||
|
$tools.AddToolVersion("R", $(Get-RVersion))
|
||||||
|
$tools.AddToolVersion("Skopeo", $(Get-SkopeoVersion))
|
||||||
|
$tools.AddToolVersion("Sphinx Open Source Search Server", $(Get-SphinxVersion))
|
||||||
|
$tools.AddToolVersion("SVN", $(Get-SVNVersion))
|
||||||
|
$tools.AddToolVersion("Terraform", $(Get-TerraformVersion))
|
||||||
|
$tools.AddToolVersion("yamllint", $(Get-YamllintVersion))
|
||||||
|
$tools.AddToolVersion("yq", $(Get-YqVersion))
|
||||||
|
$tools.AddToolVersion("zstd", $(Get-ZstdVersion))
|
||||||
|
|
||||||
|
# CLI Tools
|
||||||
|
$cliTools = $installedSoftware.AddHeader("CLI Tools")
|
||||||
|
$cliTools.AddToolVersion("Alibaba Cloud CLI", $(Get-AlibabaCloudCliVersion))
|
||||||
|
$cliTools.AddToolVersion("AWS CLI", $(Get-AWSCliVersion))
|
||||||
|
$cliTools.AddToolVersion("AWS CLI Session Manager Plugin", $(Get-AWSCliSessionManagerPluginVersion))
|
||||||
|
$cliTools.AddToolVersion("AWS SAM CLI", $(Get-AWSSAMVersion))
|
||||||
|
$cliTools.AddToolVersion("Azure CLI", $(Get-AzureCliVersion))
|
||||||
|
$cliTools.AddToolVersion("Azure CLI (azure-devops)", $(Get-AzureDevopsVersion))
|
||||||
|
$cliTools.AddToolVersion("GitHub CLI", $(Get-GitHubCliVersion))
|
||||||
|
$cliTools.AddToolVersion("Google Cloud SDK", $(Get-GoogleCloudSDKVersion))
|
||||||
|
$cliTools.AddToolVersion("Hub CLI", $(Get-HubCliVersion))
|
||||||
|
$cliTools.AddToolVersion("Netlify CLI", $(Get-NetlifyCliVersion))
|
||||||
|
$cliTools.AddToolVersion("OpenShift CLI", $(Get-OCCliVersion))
|
||||||
|
$cliTools.AddToolVersion("ORAS CLI", $(Get-ORASCliVersion))
|
||||||
|
$cliTools.AddToolVersion("Vercel CLI", $(Get-VerselCliversion))
|
||||||
|
|
||||||
|
|
||||||
|
$installedSoftware.AddHeader("Java").AddTable($(Get-JavaVersionsTable))
|
||||||
|
if ((Test-IsUbuntu20) -or (Test-IsUbuntu22)) {
|
||||||
|
$installedSoftware.AddHeader("GraalVM").AddTable($(Build-GraalVMTable))
|
||||||
}
|
}
|
||||||
|
|
||||||
$markdown += New-MDList -Style Unordered -Lines ( $databaseLists | Sort-Object )
|
$phpTools = $installedSoftware.AddHeader("PHP Tools")
|
||||||
|
$phpTools.AddToolVersionsListInline("PHP", $(Get-PHPVersions), "^\d+\.\d+")
|
||||||
|
$phpTools.AddToolVersion("Composer", $(Get-ComposerVersion))
|
||||||
|
$phpTools.AddToolVersion("PHPUnit", $(Get-PHPUnitVersion))
|
||||||
|
$phpTools.AddNote("Both Xdebug and PCOV extensions are installed, but only Xdebug is enabled.")
|
||||||
|
|
||||||
$markdown += Build-PostgreSqlSection
|
$haskellTools = $installedSoftware.AddHeader("Haskell Tools")
|
||||||
$markdown += Build-MySQLSection
|
$haskellTools.AddToolVersion("Cabal", $(Get-CabalVersion))
|
||||||
$markdown += Build-MSSQLToolsSection
|
$haskellTools.AddToolVersion("GHC", $(Get-GHCVersion))
|
||||||
|
$haskellTools.AddToolVersion("GHCup", $(Get-GHCupVersion))
|
||||||
|
$haskellTools.AddToolVersion("Stack", $(Get-StackVersion))
|
||||||
|
|
||||||
$markdown += New-MDHeader "Cached Tools" -Level 3
|
Initialize-RustEnvironment
|
||||||
$markdown += Build-CachedToolsSection
|
$rustTools = $installedSoftware.AddHeader("Rust Tools")
|
||||||
|
$rustTools.AddToolVersion("Cargo", $(Get-CargoVersion))
|
||||||
|
$rustTools.AddToolVersion("Rust", $(Get-RustVersion))
|
||||||
|
$rustTools.AddToolVersion("Rustdoc", $(Get-RustdocVersion))
|
||||||
|
$rustTools.AddToolVersion("Rustup", $(Get-RustupVersion))
|
||||||
|
$rustToolsPackages = $rustTools.AddHeader("Packages")
|
||||||
|
$rustToolsPackages.AddToolVersion("Bindgen", $(Get-BindgenVersion))
|
||||||
|
$rustToolsPackages.AddToolVersion("Cargo audit", $(Get-CargoAuditVersion))
|
||||||
|
$rustToolsPackages.AddToolVersion("Cargo clippy", $(Get-CargoClippyVersion))
|
||||||
|
$rustToolsPackages.AddToolVersion("Cargo outdated", $(Get-CargoOutdatedVersion))
|
||||||
|
$rustToolsPackages.AddToolVersion("Cbindgen", $(Get-CbindgenVersion))
|
||||||
|
$rustToolsPackages.AddToolVersion("Rustfmt", $(Get-RustfmtVersion))
|
||||||
|
|
||||||
$markdown += New-MDHeader "PowerShell Tools" -Level 3
|
$browsersTools = $installedSoftware.AddHeader("Browsers and Drivers")
|
||||||
$markdown += New-MDList -Lines (Get-PowershellVersion) -Style Unordered
|
$browsersTools.AddToolVersion("Google Chrome", $(Get-ChromeVersion))
|
||||||
|
$browsersTools.AddToolVersion("ChromeDriver", $(Get-ChromeDriverVersion))
|
||||||
|
$browsersTools.AddToolVersion("Chromium", $(Get-ChromiumVersion))
|
||||||
|
$browsersTools.AddToolVersion("Microsoft Edge", $(Get-EdgeVersion))
|
||||||
|
$browsersTools.AddToolVersion("Microsoft Edge WebDriver", $(Get-EdgeDriverVersion))
|
||||||
|
$browsersTools.AddToolVersion("Selenium server", $(Get-SeleniumVersion))
|
||||||
|
$browsersTools.AddToolVersion("Mozilla Firefox", $(Get-FirefoxVersion))
|
||||||
|
$browsersTools.AddToolVersion("Geckodriver", $(Get-GeckodriverVersion))
|
||||||
|
$browsersTools.AddHeader("Environment variables").AddTable($(Build-BrowserWebdriversEnvironmentTable))
|
||||||
|
|
||||||
$markdown += New-MDHeader "PowerShell Modules" -Level 4
|
$netCoreTools = $installedSoftware.AddHeader(".NET Core Tools")
|
||||||
$markdown += New-MDList -Lines $(Get-PowerShellModules) -Style Unordered
|
$netCoreTools.AddToolVersionsListInline(".NET Core SDK", $(Get-DotNetCoreSdkVersions), "^\d+\.\d+\.\d")
|
||||||
|
$netCoreTools.AddNodes($(Get-DotnetTools))
|
||||||
|
|
||||||
$markdown += Build-WebServersSection
|
$databasesTools = $installedSoftware.AddHeader("Databases")
|
||||||
|
if ((Test-IsUbuntu18) -or (Test-IsUbuntu20)) {
|
||||||
|
$databasesTools.AddToolVersion("MongoDB", $(Get-MongoDbVersion))
|
||||||
|
}
|
||||||
|
$databasesTools.AddToolVersion("sqlite3", $(Get-SqliteVersion))
|
||||||
|
$databasesTools.AddNode($(Build-PostgreSqlSection))
|
||||||
|
$databasesTools.AddNode($(Build-MySQLSection))
|
||||||
|
$databasesTools.AddNode($(Build-MSSQLToolsSection))
|
||||||
|
|
||||||
$markdown += New-MDHeader "Android" -Level 3
|
$cachedTools = $installedSoftware.AddHeader("Cached Tools")
|
||||||
$markdown += Build-AndroidTable | New-MDTable
|
$cachedTools.AddToolVersionsList("Go", $(Get-ToolcacheGoVersions), "^\d+\.\d+")
|
||||||
$markdown += New-MDNewLine
|
$cachedTools.AddToolVersionsList("Node.js", $(Get-ToolcacheNodeVersions), "^\d+")
|
||||||
$markdown += New-MDHeader "Environment variables" -Level 4
|
$cachedTools.AddToolVersionsList("Python", $(Get-ToolcachePythonVersions), "^\d+\.\d+")
|
||||||
$markdown += Build-AndroidEnvironmentTable | New-MDTable
|
$cachedTools.AddToolVersionsList("PyPy", $(Get-ToolcachePyPyVersions), "^\d+\.\d+")
|
||||||
$markdown += New-MDNewLine
|
$cachedTools.AddToolVersionsList("Ruby", $(Get-ToolcacheRubyVersions), "^\d+\.\d+")
|
||||||
|
|
||||||
$markdown += New-MDHeader "Cached Docker images" -Level 3
|
$powerShellTools = $installedSoftware.AddHeader("PowerShell Tools")
|
||||||
$markdown += Get-CachedDockerImagesTableData | New-MDTable
|
$powerShellTools.AddToolVersion("PowerShell", $(Get-PowershellVersion))
|
||||||
$markdown += New-MDNewLine
|
$powerShellTools.AddHeader("PowerShell Modules").AddNodes($(Get-PowerShellModules))
|
||||||
|
|
||||||
$markdown += New-MDHeader "Installed apt packages" -Level 3
|
$installedSoftware.AddHeader("Web Servers").AddTable($(Build-WebServersTable))
|
||||||
$markdown += Get-AptPackages | New-MDTable
|
|
||||||
|
|
||||||
Test-BlankElement
|
$androidTools = $installedSoftware.AddHeader("Android")
|
||||||
$markdown | Out-File -FilePath "${OutputDirectory}/Ubuntu-Readme.md"
|
$androidTools.AddTable($(Build-AndroidTable))
|
||||||
|
$androidTools.AddHeader("Environment variables").AddTable($(Build-AndroidEnvironmentTable))
|
||||||
|
|
||||||
|
$installedSoftware.AddHeader("Cached Docker images").AddTable($(Get-CachedDockerImagesTableData))
|
||||||
|
$installedSoftware.AddHeader("Installed apt packages").AddTable($(Get-AptPackages))
|
||||||
|
|
||||||
|
$softwareReport.ToJson() | Out-File -FilePath "${OutputDirectory}/software-report.json" -Encoding UTF8NoBOM
|
||||||
|
$softwareReport.ToMarkdown() | Out-File -FilePath "${OutputDirectory}/software-report.md" -Encoding UTF8NoBOM
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
function Get-JavaVersions {
|
function Get-JavaVersionsTable {
|
||||||
$javaToolcacheVersions = Get-ChildItem $env:AGENT_TOOLSDIRECTORY/Java*/* -Directory | Sort-Object { [int]$_.Name.Split(".")[0] }
|
$javaToolcacheVersions = Get-ChildItem $env:AGENT_TOOLSDIRECTORY/Java*/* -Directory | Sort-Object { [int]$_.Name.Split(".")[0] }
|
||||||
|
|
||||||
$existingVersions = $javaToolcacheVersions | ForEach-Object {
|
$existingVersions = $javaToolcacheVersions | ForEach-Object {
|
||||||
|
|||||||
@@ -5,52 +5,51 @@ function Initialize-RustEnvironment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Get-RustVersion {
|
function Get-RustVersion {
|
||||||
Initialize-RustEnvironment
|
|
||||||
$rustVersion = $(rustc --version) | Take-OutputPart -Part 1
|
$rustVersion = $(rustc --version) | Take-OutputPart -Part 1
|
||||||
return "Rust $rustVersion"
|
return $rustVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-BindgenVersion {
|
function Get-BindgenVersion {
|
||||||
$bindgenVersion = $(bindgen --version) | Take-OutputPart -Part 1
|
$bindgenVersion = $(bindgen --version) | Take-OutputPart -Part 1
|
||||||
return "Bindgen $bindgenVersion"
|
return $bindgenVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-CargoVersion {
|
function Get-CargoVersion {
|
||||||
$cargoVersion = $(cargo --version) | Take-OutputPart -Part 1
|
$cargoVersion = $(cargo --version) | Take-OutputPart -Part 1
|
||||||
return "Cargo $cargoVersion"
|
return $cargoVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-CargoAuditVersion {
|
function Get-CargoAuditVersion {
|
||||||
$cargoAuditVersion = $(cargo-audit --version) | Take-OutputPart -Part 1
|
$cargoAuditVersion = $(cargo-audit --version) | Take-OutputPart -Part 1
|
||||||
return "Cargo audit $cargoAuditVersion"
|
return $cargoAuditVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-CargoOutdatedVersion {
|
function Get-CargoOutdatedVersion {
|
||||||
$cargoOutdatedVersion = cargo outdated --version | Take-OutputPart -Part 1
|
$cargoOutdatedVersion = cargo outdated --version | Take-OutputPart -Part 1
|
||||||
return "Cargo outdated $cargoOutdatedVersion"
|
return $cargoOutdatedVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-CargoClippyVersion {
|
function Get-CargoClippyVersion {
|
||||||
$cargoClippyVersion = $(cargo-clippy --version) | Take-OutputPart -Part 1
|
$cargoClippyVersion = $(cargo-clippy --version) | Take-OutputPart -Part 1
|
||||||
return "Cargo clippy $cargoClippyVersion"
|
return $cargoClippyVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-CbindgenVersion {
|
function Get-CbindgenVersion {
|
||||||
$cbindgenVersion = $(cbindgen --version) | Take-OutputPart -Part 1
|
$cbindgenVersion = $(cbindgen --version) | Take-OutputPart -Part 1
|
||||||
return "Cbindgen $cbindgenVersion"
|
return $cbindgenVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-RustupVersion {
|
function Get-RustupVersion {
|
||||||
$rustupVersion = $(rustup --version) | Take-OutputPart -Part 1
|
$rustupVersion = $(rustup --version) | Take-OutputPart -Part 1
|
||||||
return "Rustup $rustupVersion"
|
return $rustupVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-RustdocVersion {
|
function Get-RustdocVersion {
|
||||||
$rustdocVersion = $(rustdoc --version) | Take-OutputPart -Part 1
|
$rustdocVersion = $(rustdoc --version) | Take-OutputPart -Part 1
|
||||||
return "Rustdoc $rustdocVersion"
|
return $rustdocVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-RustfmtVersion {
|
function Get-RustfmtVersion {
|
||||||
$rustfmtVersion = $(rustfmt --version) | Take-OutputPart -Part 1 | Take-OutputPart -Part 0 -Delimiter "-"
|
$rustfmtVersion = $(rustfmt --version) | Take-OutputPart -Part 1 | Take-OutputPart -Part 0 -Delimiter "-"
|
||||||
return "Rustfmt $rustfmtVersion"
|
return $rustfmtVersion
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,35 +1,33 @@
|
|||||||
function Get-AnsibleVersion {
|
function Get-AnsibleVersion {
|
||||||
$ansibleVersion = (ansible --version)[0] -replace "[^\d.]"
|
$ansibleVersion = (ansible --version)[0] -replace "[^\d.]"
|
||||||
return "Ansible $ansibleVersion"
|
return $ansibleVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-AptFastVersion {
|
function Get-AptFastVersion {
|
||||||
$versionFileContent = Get-Content (which apt-fast) -Raw
|
$versionFileContent = Get-Content (which apt-fast) -Raw
|
||||||
$match = [Regex]::Match($versionFileContent, '# apt-fast v(.+)\n')
|
$match = [Regex]::Match($versionFileContent, '# apt-fast v(.+)\n')
|
||||||
$aptFastVersion = $match.Groups[1].Value
|
return $match.Groups[1].Value
|
||||||
return "apt-fast $aptFastVersion"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-AzCopyVersion {
|
function Get-AzCopyVersion {
|
||||||
$azcopyVersion = azcopy --version | Take-OutputPart -Part 2
|
$azcopyVersion = azcopy --version | Take-OutputPart -Part 2
|
||||||
return "AzCopy $azcopyVersion - available by ``azcopy`` and ``azcopy10`` aliases"
|
return "$azcopyVersion - available by ``azcopy`` and ``azcopy10`` aliases"
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-BazelVersion {
|
function Get-BazelVersion {
|
||||||
$bazelVersion = bazel --version | Select-String "bazel" | Take-OutputPart -Part 1
|
$bazelVersion = bazel --version | Select-String "bazel" | Take-OutputPart -Part 1
|
||||||
return "Bazel $bazelVersion"
|
return $bazelVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-BazeliskVersion {
|
function Get-BazeliskVersion {
|
||||||
$result = Get-CommandResult "bazelisk version" -Multiline
|
$result = Get-CommandResult "bazelisk version" -Multiline
|
||||||
$bazeliskVersion = $result.Output | Select-String "Bazelisk version:" | Take-OutputPart -Part 2 | Take-OutputPart -Part 0 -Delimiter "v"
|
$bazeliskVersion = $result.Output | Select-String "Bazelisk version:" | Take-OutputPart -Part 2 | Take-OutputPart -Part 0 -Delimiter "v"
|
||||||
return "Bazelisk $bazeliskVersion"
|
return $bazeliskVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-BicepVersion {
|
function Get-BicepVersion {
|
||||||
(bicep --version | Out-String) -match "bicep cli version (?<version>\d+\.\d+\.\d+)" | Out-Null
|
(bicep --version | Out-String) -match "bicep cli version (?<version>\d+\.\d+\.\d+)" | Out-Null
|
||||||
$bicepVersion = $Matches.Version
|
return $Matches.Version
|
||||||
return "Bicep $bicepVersion"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-CodeQLBundleVersion {
|
function Get-CodeQLBundleVersion {
|
||||||
@@ -37,256 +35,256 @@ function Get-CodeQLBundleVersion {
|
|||||||
$CodeQLVersionPath = Get-ChildItem $CodeQLVersionsWildcard | Select-Object -First 1 -Expand FullName
|
$CodeQLVersionPath = Get-ChildItem $CodeQLVersionsWildcard | Select-Object -First 1 -Expand FullName
|
||||||
$CodeQLPath = Join-Path $CodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql"
|
$CodeQLPath = Join-Path $CodeQLVersionPath -ChildPath "x64" | Join-Path -ChildPath "codeql" | Join-Path -ChildPath "codeql"
|
||||||
$CodeQLVersion = & $CodeQLPath version --quiet
|
$CodeQLVersion = & $CodeQLPath version --quiet
|
||||||
return "CodeQL Action Bundle $CodeQLVersion"
|
return $CodeQLVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-PodManVersion {
|
function Get-PodManVersion {
|
||||||
$podmanVersion = podman --version | Take-OutputPart -Part 2
|
$podmanVersion = podman --version | Take-OutputPart -Part 2
|
||||||
return "Podman $podmanVersion"
|
return $podmanVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-BuildahVersion {
|
function Get-BuildahVersion {
|
||||||
$buildahVersion = buildah --version | Take-OutputPart -Part 2
|
$buildahVersion = buildah --version | Take-OutputPart -Part 2
|
||||||
return "Buildah $buildahVersion"
|
return $buildahVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-SkopeoVersion {
|
function Get-SkopeoVersion {
|
||||||
$skopeoVersion = skopeo --version | Take-OutputPart -Part 2
|
$skopeoVersion = skopeo --version | Take-OutputPart -Part 2
|
||||||
return "Skopeo $skopeoVersion"
|
return $skopeoVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-CMakeVersion {
|
function Get-CMakeVersion {
|
||||||
$cmakeVersion = cmake --version | Select-Object -First 1 | Take-OutputPart -Part 2
|
$cmakeVersion = cmake --version | Select-Object -First 1 | Take-OutputPart -Part 2
|
||||||
return "CMake $cmakeVersion"
|
return $cmakeVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-DockerComposeV1Version {
|
function Get-DockerComposeV1Version {
|
||||||
$composeVersion = docker-compose -v | Take-OutputPart -Part 2 | Take-OutputPart -Part 0 -Delimiter ","
|
$composeVersion = docker-compose -v | Take-OutputPart -Part 2 | Take-OutputPart -Part 0 -Delimiter ","
|
||||||
return "Docker Compose v1 $composeVersion"
|
return $composeVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-DockerComposeV2Version {
|
function Get-DockerComposeV2Version {
|
||||||
$composeVersion = docker compose version | Take-OutputPart -Part 3
|
$composeVersion = docker compose version | Take-OutputPart -Part 3
|
||||||
return "Docker Compose v2 $composeVersion"
|
return $composeVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-DockerMobyClientVersion {
|
function Get-DockerMobyClientVersion {
|
||||||
$dockerClientVersion = sudo docker version --format '{{.Client.Version}}'
|
$dockerClientVersion = sudo docker version --format '{{.Client.Version}}'
|
||||||
return "Docker-Moby Client $dockerClientVersion"
|
return $dockerClientVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-DockerMobyServerVersion {
|
function Get-DockerMobyServerVersion {
|
||||||
$dockerServerVersion = sudo docker version --format '{{.Server.Version}}'
|
$dockerServerVersion = sudo docker version --format '{{.Server.Version}}'
|
||||||
return "Docker-Moby Server $dockerServerVersion"
|
return $dockerServerVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-DockerBuildxVersion {
|
function Get-DockerBuildxVersion {
|
||||||
$buildxVersion = docker buildx version | Take-OutputPart -Part 1 | Take-OutputPart -Part 0 -Delimiter "+"
|
$buildxVersion = docker buildx version | Take-OutputPart -Part 1 | Take-OutputPart -Part 0 -Delimiter "+"
|
||||||
return "Docker-Buildx $buildxVersion"
|
return $buildxVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-DockerAmazonECRCredHelperVersion {
|
function Get-DockerAmazonECRCredHelperVersion {
|
||||||
$ecrVersion = docker-credential-ecr-login -v | Select-String "Version:" | Take-OutputPart -Part 1
|
$ecrVersion = docker-credential-ecr-login -v | Select-String "Version:" | Take-OutputPart -Part 1
|
||||||
return "Docker Amazon ECR Credential Helper $ecrVersion"
|
return $ecrVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-GitVersion {
|
function Get-GitVersion {
|
||||||
$gitVersion = git --version | Take-OutputPart -Part -1
|
$gitVersion = git --version | Take-OutputPart -Part -1
|
||||||
return "Git $gitVersion"
|
return $gitVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-GitLFSVersion {
|
function Get-GitLFSVersion {
|
||||||
$result = Get-CommandResult "git-lfs --version"
|
$result = Get-CommandResult "git-lfs --version"
|
||||||
$gitlfsversion = $result.Output | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "/"
|
$gitlfsversion = $result.Output | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "/"
|
||||||
return "Git LFS $gitlfsversion"
|
return $gitlfsversion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-GitFTPVersion {
|
function Get-GitFTPVersion {
|
||||||
$gitftpVersion = git-ftp --version | Take-OutputPart -Part 2
|
$gitftpVersion = git-ftp --version | Take-OutputPart -Part 2
|
||||||
return "Git-ftp $gitftpVersion"
|
return $gitftpVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-GoogleCloudSDKVersion {
|
function Get-GoogleCloudSDKVersion {
|
||||||
return gcloud --version | Select-Object -First 1
|
return (gcloud --version | Select-Object -First 1) | Take-OutputPart -Part 3
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-HavegedVersion {
|
function Get-HavegedVersion {
|
||||||
$havegedVersion = dpkg-query --showformat='${Version}' --show haveged | Take-OutputPart -Part 0 -Delimiter "-"
|
$havegedVersion = dpkg-query --showformat='${Version}' --show haveged | Take-OutputPart -Part 0 -Delimiter "-"
|
||||||
return "Haveged $havegedVersion"
|
return $havegedVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-HerokuVersion {
|
function Get-HerokuVersion {
|
||||||
$herokuVersion = heroku version | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "/"
|
$herokuVersion = heroku version | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "/"
|
||||||
return "Heroku $herokuVersion"
|
return $herokuVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-HHVMVersion {
|
function Get-HHVMVersion {
|
||||||
$hhvmVersion = hhvm --version | Select-Object -First 1 | Take-OutputPart -Part 2
|
$hhvmVersion = hhvm --version | Select-Object -First 1 | Take-OutputPart -Part 2
|
||||||
return "HHVM (HipHop VM) $hhvmVersion"
|
return $hhvmVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-SVNVersion {
|
function Get-SVNVersion {
|
||||||
$svnVersion = svn --version | Select-Object -First 1 | Take-OutputPart -Part 2
|
$svnVersion = svn --version | Select-Object -First 1 | Take-OutputPart -Part 2
|
||||||
return "SVN $svnVersion"
|
return $svnVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-KustomizeVersion {
|
function Get-KustomizeVersion {
|
||||||
$kustomizeVersion = kustomize version --short | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "v"
|
$kustomizeVersion = kustomize version --short | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "v"
|
||||||
return "Kustomize $kustomizeVersion"
|
return $kustomizeVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-KindVersion {
|
function Get-KindVersion {
|
||||||
$kindVersion = kind version | Take-OutputPart -Part 1 | Take-OutputPart -Part 0 -Delimiter "v"
|
$kindVersion = kind version | Take-OutputPart -Part 1 | Take-OutputPart -Part 0 -Delimiter "v"
|
||||||
return "Kind $kindVersion"
|
return $kindVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-KubectlVersion {
|
function Get-KubectlVersion {
|
||||||
$kubectlVersion = (kubectl version --client --output=json | ConvertFrom-Json).clientVersion.gitVersion.Replace('v','')
|
$kubectlVersion = (kubectl version --client --output=json | ConvertFrom-Json).clientVersion.gitVersion.Replace('v','')
|
||||||
return "Kubectl $kubectlVersion"
|
return $kubectlVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-MinikubeVersion {
|
function Get-MinikubeVersion {
|
||||||
$minikubeVersion = minikube version --short | Take-OutputPart -Part 0 -Delimiter "v"
|
$minikubeVersion = minikube version --short | Take-OutputPart -Part 0 -Delimiter "v"
|
||||||
return "Minikube $minikubeVersion"
|
return $minikubeVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-HGVersion {
|
function Get-HGVersion {
|
||||||
$hgVersion = hg --version | Select-Object -First 1 | Take-OutputPart -Part -1 | Take-OutputPart -Part 0 -Delimiter ")"
|
$hgVersion = hg --version | Select-Object -First 1 | Take-OutputPart -Part -1 | Take-OutputPart -Part 0 -Delimiter ")"
|
||||||
return "Mercurial $hgVersion"
|
return $hgVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-LeiningenVersion {
|
function Get-LeiningenVersion {
|
||||||
return "$(lein -v | Take-OutputPart -Part 0,1)"
|
return "$(lein -v | Take-OutputPart -Part 1)"
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-MediainfoVersion {
|
function Get-MediainfoVersion {
|
||||||
$mediainfoVersion = (mediainfo --version | Select-Object -Index 1 | Take-OutputPart -Part 2).Replace('v', '')
|
$mediainfoVersion = (mediainfo --version | Select-Object -Index 1 | Take-OutputPart -Part 2).Replace('v', '')
|
||||||
return "MediaInfo $mediainfoVersion"
|
return $mediainfoVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-NewmanVersion {
|
function Get-NewmanVersion {
|
||||||
return "Newman $(newman --version)"
|
return $(newman --version)
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-NVersion {
|
function Get-NVersion {
|
||||||
$nVersion = (n --version).Replace('v', '')
|
$nVersion = (n --version).Replace('v', '')
|
||||||
return "n $nVersion"
|
return $nVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-NvmVersion {
|
function Get-NvmVersion {
|
||||||
$nvmVersion = bash -c "source /etc/skel/.nvm/nvm.sh && nvm --version"
|
$nvmVersion = bash -c "source /etc/skel/.nvm/nvm.sh && nvm --version"
|
||||||
return "nvm $nvmVersion"
|
return $nvmVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-PackerVersion {
|
function Get-PackerVersion {
|
||||||
# Packer 1.7.1 has a bug and outputs version to stderr instead of stdout https://github.com/hashicorp/packer/issues/10855
|
# Packer 1.7.1 has a bug and outputs version to stderr instead of stdout https://github.com/hashicorp/packer/issues/10855
|
||||||
$result = (Get-CommandResult "packer --version").Output
|
$result = (Get-CommandResult "packer --version").Output
|
||||||
$packerVersion = [regex]::matches($result, "(\d+.){2}\d+").Value
|
$packerVersion = [regex]::matches($result, "(\d+.){2}\d+").Value
|
||||||
return "Packer $packerVersion"
|
return $packerVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-PhantomJSVersion {
|
function Get-PhantomJSVersion {
|
||||||
return "PhantomJS $(phantomjs --version)"
|
return $(phantomjs --version)
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-TerraformVersion {
|
function Get-TerraformVersion {
|
||||||
return (terraform version | Select-String "^Terraform").Line.Replace('v','')
|
return (terraform version | Select-String "^Terraform").Line.Replace('v','') | Take-OutputPart -Part 1
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-JqVersion {
|
function Get-JqVersion {
|
||||||
$jqVersion = jq --version | Take-OutputPart -Part 1 -Delimiter "-"
|
$jqVersion = jq --version | Take-OutputPart -Part 1 -Delimiter "-"
|
||||||
return "jq $jqVersion"
|
return $jqVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-AzureCliVersion {
|
function Get-AzureCliVersion {
|
||||||
$azcliVersion = (az version | ConvertFrom-Json).'azure-cli'
|
$azcliVersion = (az version | ConvertFrom-Json).'azure-cli'
|
||||||
return "Azure CLI $azcliVersion"
|
return $azcliVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-AzureDevopsVersion {
|
function Get-AzureDevopsVersion {
|
||||||
$azdevopsVersion = (az version | ConvertFrom-Json).extensions.'azure-devops'
|
$azdevopsVersion = (az version | ConvertFrom-Json).extensions.'azure-devops'
|
||||||
return "Azure CLI (azure-devops) $azdevopsVersion"
|
return $azdevopsVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-AlibabaCloudCliVersion {
|
function Get-AlibabaCloudCliVersion {
|
||||||
return "Alibaba Cloud CLI $(aliyun version)"
|
return $(aliyun version)
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-AWSCliVersion {
|
function Get-AWSCliVersion {
|
||||||
$result = Get-CommandResult "aws --version"
|
$result = Get-CommandResult "aws --version"
|
||||||
$awsVersion = $result.Output | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "/"
|
$awsVersion = $result.Output | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "/"
|
||||||
return "AWS CLI $awsVersion"
|
return $awsVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-AWSCliSessionManagerPluginVersion {
|
function Get-AWSCliSessionManagerPluginVersion {
|
||||||
$result = (Get-CommandResult "session-manager-plugin --version").Output
|
$result = (Get-CommandResult "session-manager-plugin --version").Output
|
||||||
return "AWS CLI Session manager plugin $result"
|
return $result
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-AWSSAMVersion {
|
function Get-AWSSAMVersion {
|
||||||
return "AWS SAM CLI $(sam --version | Take-OutputPart -Part -1)"
|
return $(sam --version | Take-OutputPart -Part -1)
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-FastlaneVersion {
|
function Get-FastlaneVersion {
|
||||||
$fastlaneVersion = fastlane --version | Select-String "^fastlane [0-9]" | Take-OutputPart -Part 1
|
$fastlaneVersion = fastlane --version | Select-String "^fastlane [0-9]" | Take-OutputPart -Part 1
|
||||||
return "Fastlane $fastlaneVersion"
|
return $fastlaneVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-HubCliVersion {
|
function Get-HubCliVersion {
|
||||||
$hubVersion = hub --version | Select-String "hub version" | Take-OutputPart -Part 2
|
$hubVersion = hub --version | Select-String "hub version" | Take-OutputPart -Part 2
|
||||||
return "Hub CLI $hubVersion"
|
return $hubVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-GitHubCliVersion {
|
function Get-GitHubCliVersion {
|
||||||
$ghVersion = gh --version | Select-String "gh version" | Take-OutputPart -Part 2
|
$ghVersion = gh --version | Select-String "gh version" | Take-OutputPart -Part 2
|
||||||
return "GitHub CLI $ghVersion"
|
return $ghVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-NetlifyCliVersion {
|
function Get-NetlifyCliVersion {
|
||||||
$netlifyVersion = netlify --version | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "/"
|
$netlifyVersion = netlify --version | Take-OutputPart -Part 0 | Take-OutputPart -Part 1 -Delimiter "/"
|
||||||
return "Netlify CLI $netlifyVersion"
|
return $netlifyVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-OCCliVersion {
|
function Get-OCCliVersion {
|
||||||
$ocVersion = oc version -o=json | jq -r '.releaseClientVersion'
|
$ocVersion = oc version -o=json | jq -r '.releaseClientVersion'
|
||||||
return "OpenShift CLI $ocVersion"
|
return $ocVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-ORASCliVersion {
|
function Get-ORASCliVersion {
|
||||||
$orasVersion = oras version | Select-String "^Version:" | Take-OutputPart -Part 1
|
$orasVersion = oras version | Select-String "^Version:" | Take-OutputPart -Part 1
|
||||||
return "ORAS CLI $orasVersion"
|
return $orasVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-VerselCliversion {
|
function Get-VerselCliversion {
|
||||||
$result = Get-CommandResult "vercel --version" -Multiline
|
$result = Get-CommandResult "vercel --version" -Multiline
|
||||||
return $result.Output | Select-Object -First 1
|
return $result.Output | Select-Object -Skip 1 -First 1
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-PulumiVersion {
|
function Get-PulumiVersion {
|
||||||
$pulumiVersion = pulumi version | Take-OutputPart -Part 0 -Delimiter "v"
|
$pulumiVersion = pulumi version | Take-OutputPart -Part 0 -Delimiter "v"
|
||||||
return "Pulumi $pulumiVersion"
|
return $pulumiVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-RVersion {
|
function Get-RVersion {
|
||||||
$rVersion = (Get-CommandResult "R --version | grep 'R version'").Output | Take-OutputPart -Part 2
|
$rVersion = (Get-CommandResult "R --version | grep 'R version'").Output | Take-OutputPart -Part 2
|
||||||
return "R $rVersion"
|
return $rVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-SphinxVersion {
|
function Get-SphinxVersion {
|
||||||
$sphinxVersion = searchd -h | Select-Object -First 1 | Take-OutputPart -Part 1 | Take-OutputPart -Part 0 -Delimiter "-"
|
$sphinxVersion = searchd -h | Select-Object -First 1 | Take-OutputPart -Part 1 | Take-OutputPart -Part 0 -Delimiter "-"
|
||||||
return "Sphinx Open Source Search Server $sphinxVersion"
|
return $sphinxVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-YamllintVersion {
|
function Get-YamllintVersion {
|
||||||
return "$(yamllint --version)"
|
return $(yamllint --version) | Take-OutputPart -Part 1
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-ZstdVersion {
|
function Get-ZstdVersion {
|
||||||
$zstdVersion = zstd --version | Take-OutputPart -Part 1 -Delimiter "v" | Take-OutputPart -Part 0 -Delimiter ","
|
$zstdVersion = zstd --version | Take-OutputPart -Part 1 -Delimiter "v" | Take-OutputPart -Part 0 -Delimiter ","
|
||||||
return "zstd $zstdVersion (Homebrew)"
|
return "$zstdVersion (Homebrew)"
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-YqVersion {
|
function Get-YqVersion {
|
||||||
$yqVersion = ($(yq -V) -Split " ")[-1]
|
$yqVersion = ($(yq -V) -Split " ")[-1]
|
||||||
return "yq $yqVersion"
|
return $yqVersion
|
||||||
}
|
}
|
||||||
@@ -43,19 +43,13 @@ function Get-Xsp4Version {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function Build-WebServersSection {
|
function Build-WebServersTable {
|
||||||
$servers = @(
|
$servers = @()
|
||||||
(Get-ApacheVersion),
|
$servers += (Get-ApacheVersion)
|
||||||
(Get-NginxVersion)
|
|
||||||
)
|
|
||||||
if (Test-IsUbuntu20) {
|
if (Test-IsUbuntu20) {
|
||||||
$servers += (Get-Xsp4Version)
|
$servers += (Get-Xsp4Version)
|
||||||
}
|
}
|
||||||
|
$servers += (Get-NginxVersion)
|
||||||
|
|
||||||
$output = ""
|
return $servers
|
||||||
$output += New-MDHeader "Web Servers" -Level 3
|
|
||||||
$output += $servers | Sort-Object Name | New-MDTable
|
|
||||||
$output += New-MDNewLine
|
|
||||||
|
|
||||||
return $output
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,14 +10,6 @@ function Take-OutputPart {
|
|||||||
return [string]::Join($Delimiter, $selectedParts)
|
return [string]::Join($Delimiter, $selectedParts)
|
||||||
}
|
}
|
||||||
|
|
||||||
function New-MDNewLine {
|
|
||||||
param (
|
|
||||||
[int] $Count = 1
|
|
||||||
)
|
|
||||||
$newLineSymbol = [System.Environment]::NewLine
|
|
||||||
return $newLineSymbol * $Count
|
|
||||||
}
|
|
||||||
|
|
||||||
function Restore-UserOwner {
|
function Restore-UserOwner {
|
||||||
sudo chown -R ${env:USER}: $env:HOME
|
sudo chown -R ${env:USER}: $env:HOME
|
||||||
}
|
}
|
||||||
@@ -41,118 +33,9 @@ function Get-PathWithLink {
|
|||||||
return "${inputPath}${link}"
|
return "${inputPath}${link}"
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-CachedToolInstances
|
|
||||||
{
|
|
||||||
<#
|
|
||||||
.SYNOPSIS
|
|
||||||
Returns hastable of installed cached tools.
|
|
||||||
|
|
||||||
.DESCRIPTION
|
|
||||||
Return hastable that contains versions and architectures for selected cached tool.
|
|
||||||
|
|
||||||
.PARAMETER Name
|
|
||||||
Name of cached tool.
|
|
||||||
|
|
||||||
.PARAMETER VersionCommand
|
|
||||||
Optional parameter. Command to return version of system default tool.
|
|
||||||
|
|
||||||
.EXAMPLE
|
|
||||||
Get-CachedToolInstances -Name "Python" -VersionCommand "--version"
|
|
||||||
|
|
||||||
#>
|
|
||||||
|
|
||||||
param
|
|
||||||
(
|
|
||||||
[String] $Name,
|
|
||||||
[String] $VersionCommand
|
|
||||||
)
|
|
||||||
|
|
||||||
$toolInstances = @()
|
|
||||||
$toolPath = Join-Path -Path $env:AGENT_TOOLSDIRECTORY -ChildPath $Name
|
|
||||||
|
|
||||||
# Get all installed versions from TOOLSDIRECTORY folder
|
|
||||||
$versions = Get-ChildItem $toolPath | Sort-Object { [System.Version]$_.Name }
|
|
||||||
foreach ($version in $versions)
|
|
||||||
{
|
|
||||||
$instanceInfo = @{}
|
|
||||||
|
|
||||||
# Create instance hashtable
|
|
||||||
[string]$instanceInfo.Path = Join-Path -Path $toolPath -ChildPath $version.Name
|
|
||||||
[string]$instanceInfo.Version = $version.Name
|
|
||||||
|
|
||||||
# Get all architectures for current version
|
|
||||||
[array]$instanceInfo.Architecture_Array = Get-ChildItem $version.FullName -Name -Directory | Where-Object { $_ -match "^x[0-9]{2}$" }
|
|
||||||
[string]$instanceInfo.Architecture = $instanceInfo.Architecture_Array -Join ", "
|
|
||||||
|
|
||||||
# Add (default) postfix to version name, in case if current version is in environment path
|
|
||||||
if (-not ([string]::IsNullOrEmpty($VersionCommand)))
|
|
||||||
{
|
|
||||||
$defaultVersion = $(& ($Name.ToLower()) $VersionCommand 2>&1)
|
|
||||||
$defaultToolVersion = $defaultVersion | Select-String -Pattern "\d+\.\d+\.\d+" -AllMatches `
|
|
||||||
| ForEach-Object { $_.Matches.Value }
|
|
||||||
|
|
||||||
if ([version]$version.Name -eq [version]$defaultToolVersion)
|
|
||||||
{
|
|
||||||
$instanceInfo.Version += " (Default)"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$toolInstances += $instanceInfo
|
|
||||||
}
|
|
||||||
|
|
||||||
return $toolInstances
|
|
||||||
}
|
|
||||||
|
|
||||||
function Get-AptSourceRepository {
|
function Get-AptSourceRepository {
|
||||||
param([String] $PackageName)
|
param([String] $PackageName)
|
||||||
|
|
||||||
$sourceUrl = Get-Content "$PSScriptRoot/../helpers/apt-sources.txt" | Select-String -Pattern $PackageName | Take-OutputPart -Part (1..3)
|
$sourceUrl = Get-Content "$PSScriptRoot/../helpers/apt-sources.txt" | Select-String -Pattern $PackageName | Take-OutputPart -Part (1..3)
|
||||||
return $sourceUrl
|
return $sourceUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
function Test-BlankElement {
|
|
||||||
param(
|
|
||||||
[string] $Markdown
|
|
||||||
)
|
|
||||||
|
|
||||||
$splitByLines = $Markdown.Split("`n")
|
|
||||||
# Validate entry without version
|
|
||||||
$blankVersions = $splitByLines -match "^-" -notmatch "Image Version|MySQL Server|Vcpkg|\d\." | Out-String
|
|
||||||
|
|
||||||
# Validate tables with blank rows
|
|
||||||
$blankRows = ""
|
|
||||||
for($i = 0; $i -lt $splitByLines.Length; $i++) {
|
|
||||||
$addRows= $false
|
|
||||||
$table = @()
|
|
||||||
if ($splitByLines[$i].StartsWith("#") -and $splitByLines[$i+1].StartsWith("|")) {
|
|
||||||
$table += $splitByLines[$i,($i+1),($i+2)]
|
|
||||||
$i += 3
|
|
||||||
$current = $splitByLines[$i]
|
|
||||||
while ($current.StartsWith("|")) {
|
|
||||||
$isBlankRow = $current.Substring(1, $current.LastIndexOf("|") - 2).Split("|").Trim() -contains ""
|
|
||||||
if ($isBlankRow) {
|
|
||||||
$table += $current
|
|
||||||
$addRows = $true
|
|
||||||
}
|
|
||||||
$current = $splitByLines[++$i]
|
|
||||||
}
|
|
||||||
if ($addRows) {
|
|
||||||
$blankRows += $table | Out-String
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Display report
|
|
||||||
$isReport = $false
|
|
||||||
if ($blankVersions) {
|
|
||||||
Write-Host "Software list with blank version:`n${blankVersions}"
|
|
||||||
$isReport = $true
|
|
||||||
}
|
|
||||||
if ($blankRows) {
|
|
||||||
Write-Host "Tables with blank rows:`n${blankRows}"
|
|
||||||
$isReport = $true
|
|
||||||
}
|
|
||||||
if ($isReport) {
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -120,6 +120,11 @@
|
|||||||
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
||||||
"destination": "{{user `image_folder`}}"
|
"destination": "{{user `image_folder`}}"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"source": "{{ template_dir }}/../../helpers/software-report-base",
|
||||||
|
"destination": "{{user `image_folder`}}/SoftwareReport/"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"source": "{{template_dir}}/toolsets/toolset-1804.json",
|
"source": "{{template_dir}}/toolsets/toolset-1804.json",
|
||||||
@@ -331,10 +336,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"source": "{{user `image_folder`}}/Ubuntu-Readme.md",
|
"source": "{{user `image_folder`}}/software-report.md",
|
||||||
"destination": "{{template_dir}}/Ubuntu1804-Readme.md",
|
"destination": "{{template_dir}}/Ubuntu1804-Readme.md",
|
||||||
"direction": "download"
|
"direction": "download"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"source": "{{user `image_folder`}}/software-report.json",
|
||||||
|
"destination": "{{template_dir}}/software-report.json",
|
||||||
|
"direction": "download"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"scripts":[
|
"scripts":[
|
||||||
|
|||||||
@@ -120,6 +120,11 @@
|
|||||||
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
"source": "{{ template_dir }}/scripts/SoftwareReport",
|
||||||
"destination": "{{user `image_folder`}}"
|
"destination": "{{user `image_folder`}}"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"source": "{{ template_dir }}/../../helpers/software-report-base",
|
||||||
|
"destination": "{{user `image_folder`}}/SoftwareReport/"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"source": "{{template_dir}}/toolsets/toolset-2004.json",
|
"source": "{{template_dir}}/toolsets/toolset-2004.json",
|
||||||
@@ -336,10 +341,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"source": "{{user `image_folder`}}/Ubuntu-Readme.md",
|
"source": "{{user `image_folder`}}/software-report.md",
|
||||||
"destination": "{{template_dir}}/Ubuntu2004-Readme.md",
|
"destination": "{{template_dir}}/Ubuntu2004-Readme.md",
|
||||||
"direction": "download"
|
"direction": "download"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"source": "{{user `image_folder`}}/software-report.json",
|
||||||
|
"destination": "{{template_dir}}/software-report.json",
|
||||||
|
"direction": "download"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"scripts":[
|
"scripts":[
|
||||||
|
|||||||
@@ -234,6 +234,11 @@ build {
|
|||||||
source = "${path.root}/scripts/SoftwareReport"
|
source = "${path.root}/scripts/SoftwareReport"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
provisioner "file" {
|
||||||
|
destination = "${var.image_folder}/SoftwareReport/"
|
||||||
|
source = "${path.root}/../../helpers/software-report-base"
|
||||||
|
}
|
||||||
|
|
||||||
provisioner "file" {
|
provisioner "file" {
|
||||||
destination = "${var.installer_script_folder}/toolset.json"
|
destination = "${var.installer_script_folder}/toolset.json"
|
||||||
source = "${path.root}/toolsets/toolset-2204.json"
|
source = "${path.root}/toolsets/toolset-2204.json"
|
||||||
@@ -382,7 +387,13 @@ build {
|
|||||||
provisioner "file" {
|
provisioner "file" {
|
||||||
destination = "${path.root}/Ubuntu2204-Readme.md"
|
destination = "${path.root}/Ubuntu2204-Readme.md"
|
||||||
direction = "download"
|
direction = "download"
|
||||||
source = "${var.image_folder}/Ubuntu-Readme.md"
|
source = "${var.image_folder}/software-report.md"
|
||||||
|
}
|
||||||
|
|
||||||
|
provisioner "file" {
|
||||||
|
destination = "${path.root}/software-report.json"
|
||||||
|
direction = "download"
|
||||||
|
source = "${var.image_folder}/software-report.json"
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
|
|||||||
Reference in New Issue
Block a user