From 4462fe7121d130fb84f066685858f97217094f09 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Wed, 16 Dec 2020 05:47:43 -0500 Subject: [PATCH] Add Boost env variable to Linux docs (#2043) * Add Boost env variable to Linux docs * Revert "Add Boost env variable to Linux docs" This reverts commit 67a54f233cf332cd1550d35927580e4998dd032a. * Update script to generate Boost variables for linux * updated software report script to correct version * Lots of fixes * fix markdown formatting --- .../SoftwareReport.CachedTools.psm1 | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) mode change 100644 => 100755 images/linux/scripts/SoftwareReport/SoftwareReport.CachedTools.psm1 diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.CachedTools.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.CachedTools.psm1 old mode 100644 new mode 100755 index 24283ba64..e82c2da6a --- a/images/linux/scripts/SoftwareReport/SoftwareReport.CachedTools.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.CachedTools.psm1 @@ -29,11 +29,36 @@ function Get-ToolcacheGoVersions { } function Get-ToolcacheBoostVersions { + $Name = "Boost" $toolcachePath = Join-Path $env:AGENT_TOOLSDIRECTORY "boost" if (-not (Test-Path $toolcachePath)) { return @() } - return Get-ChildItem $toolcachePath -Name | Sort-Object { [Version]$_ } + + $BoostVersions = Get-ChildItem $toolcachePath -Name | Sort-Object { [Version]$_ } + $ToolInstances = $BoostVersions | ForEach-Object { + $VersionEnvVar = $_.replace(".", "_") + return @{ + Version = $_ + Architecture = "x64" + "Environment Variable" = "BOOST_ROOT_${VersionEnvVar}" + + } + } + $Content = $ToolInstances | New-MDTable -Columns ([ordered]@{ + Version = "left"; + Architecture = "left"; + "Environment Variable" = "left" + }) + + $markdown = "" + + if ($Content.Count -gt 0) { + $markdown += New-MDHeader $Name -Level 4 + $markdown += New-MDParagraph -Lines $Content + } + + return $markdown } function Build-CachedToolsSection { @@ -54,11 +79,7 @@ function Build-CachedToolsSection { $output += New-MDHeader "Go" -Level 4 $output += New-MDList -Lines (Get-ToolcacheGoVersions) -Style Unordered - $boostVersions = Get-ToolcacheBoostVersions - if ($boostVersions.Count -gt 0) { - $output += New-MDHeader "Boost" -Level 4 - $output += New-MDList -Lines $boostVersions -Style Unordered - } + $output += Get-ToolcacheBoostVersions return $output } \ No newline at end of file