diff --git a/images/macos/helpers/SoftwareReport.Helpers.psm1 b/images/macos/helpers/SoftwareReport.Helpers.psm1 index 2742bad15..6f1bac5b5 100644 --- a/images/macos/helpers/SoftwareReport.Helpers.psm1 +++ b/images/macos/helpers/SoftwareReport.Helpers.psm1 @@ -30,3 +30,22 @@ function New-MDNewLine { $newLineSymbol = [System.Environment]::NewLine return $newLineSymbol * $Count } + +function Get-LinkTarget { + param ( + [string] $inputPath + ) + $link = Get-Item $inputPath | Select-Object -ExpandProperty Target + if ($link) { + return " -> $link" + } + return "" +} + +function Get-PathWithLink { + param ( + [string] $inputPath + ) + $link = Get-LinkTarget($inputPath) + return "${inputPath}${link}" +} diff --git a/images/macos/software-report/SoftwareReport.Android.psm1 b/images/macos/software-report/SoftwareReport.Android.psm1 index 9640da369..db5955d26 100644 --- a/images/macos/software-report/SoftwareReport.Android.psm1 +++ b/images/macos/software-report/SoftwareReport.Android.psm1 @@ -1,3 +1,5 @@ +Import-Module "$PSScriptRoot/../helpers/SoftwareReport.Helpers.psm1" -DisableNameChecking + function Split-TableRowByColumns { param( [string] $Row @@ -98,6 +100,18 @@ function Build-AndroidTable { } } +function Build-AndroidEnvironmentTable { + $androidVersions = Get-Item env:ANDROID_* + + $shoulddResolveLink = 'ANDROID_NDK_PATH', 'ANDROID_NDK_HOME', 'ANDROID_NDK_ROOT', 'ANDROID_NDK_LATEST_HOME' + return $androidVersions | Sort-Object -Property Name | ForEach-Object { + [PSCustomObject] @{ + "Name" = $_.Name + "Value" = if ($shoulddResolveLink.Contains($_.Name )) { Get-PathWithLink($_.Value) } else {$_.Value} + } + } +} + function Get-AndroidPackageVersions { param ( [Parameter(Mandatory)] diff --git a/images/macos/software-report/SoftwareReport.Browsers.psm1 b/images/macos/software-report/SoftwareReport.Browsers.psm1 index 4e46f79f4..0d4b6b028 100644 --- a/images/macos/software-report/SoftwareReport.Browsers.psm1 +++ b/images/macos/software-report/SoftwareReport.Browsers.psm1 @@ -49,4 +49,26 @@ function Get-FirefoxVersion { function Get-GeckodriverVersion { return Run-Command "geckodriver --version" | Select-Object -First 1 -} \ No newline at end of file +} + +function Build-BrowserWebdriversEnvironmentTable { + return @( + @{ + "Name" = "CHROMEWEBDRIVER" + "Value" = $env:CHROMEWEBDRIVER + }, + @{ + "Name" = "EDGEWEBDRIVER" + "Value" = $env:EDGEWEBDRIVER + }, + @{ + "Name" = "GECKOWEBDRIVER" + "Value" = $env:GECKOWEBDRIVER + } + ) | ForEach-Object { + [PSCustomObject] @{ + "Name" = $_.Name + "Value" = $_.Value + } + } +} diff --git a/images/macos/software-report/SoftwareReport.Common.psm1 b/images/macos/software-report/SoftwareReport.Common.psm1 index e98a96df1..7786c7ade 100644 --- a/images/macos/software-report/SoftwareReport.Common.psm1 +++ b/images/macos/software-report/SoftwareReport.Common.psm1 @@ -1,5 +1,3 @@ -Import-Module "$PSScriptRoot/../helpers/SoftwareReport.Helpers.psm1" -DisableNameChecking - function Get-BashVersion { $version = bash -c 'echo ${BASH_VERSION}' return "Bash $version" @@ -472,4 +470,22 @@ function Get-SwiftLintVersion { function Get-PowershellVersion { $powershellVersion = Run-Command "powershell --version" return $powershellVersion -} \ No newline at end of file +} + +function Build-PackageManagementEnvironmentTable { + return @( + @{ + "Name" = "CONDA" + "Value" = $env:CONDA + }, + @{ + "Name" = "VCPKG_INSTALLATION_ROOT" + "Value" = $env:VCPKG_INSTALLATION_ROOT + } + ) | ForEach-Object { + [PSCustomObject] @{ + "Name" = $_.Name + "Value" = $_.Value + } + } +} diff --git a/images/macos/software-report/SoftwareReport.Generator.ps1 b/images/macos/software-report/SoftwareReport.Generator.ps1 index e3b50aeb4..d7a9bacfc 100644 --- a/images/macos/software-report/SoftwareReport.Generator.ps1 +++ b/images/macos/software-report/SoftwareReport.Generator.ps1 @@ -86,6 +86,9 @@ if ($os.IsHigherThanMojave) { } $markdown += New-MDList -Style Unordered -Lines ($packageManagementList | Sort-Object) +$markdown += New-MDHeader "Environment variables" -Level 4 +$markdown += Build-PackageManagementEnvironmentTable | New-MDTable +$markdown += New-MDNewLine # Project Management $markdown += New-MDHeader "Project Management" -Level 3 @@ -183,6 +186,9 @@ $markdown += New-MDList -Style Unordered -Lines ($lintersList | Sort-Object) $markdown += New-MDHeader "Browsers" -Level 3 $markdown += Get-BrowserSection +$markdown += New-MDHeader "Environment variables" -Level 4 +$markdown += Build-BrowserWebdriversEnvironmentTable | New-MDTable +$markdown += New-MDNewLine $markdown += New-MDHeader "Java" -Level 3 $markdown += Get-JavaVersions | New-MDTable @@ -267,6 +273,9 @@ $markdown += New-MDNewLine $markdown += New-MDHeader "Android" -Level 3 $markdown += Build-AndroidTable | New-MDTable $markdown += New-MDNewLine +$markdown += New-MDHeader "Environment variables" -Level 4 +$markdown += Build-AndroidEnvironmentTable | New-MDTable +$markdown += New-MDNewLine # # Generate systeminfo.txt with information about image (for debug purpose)