diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 index 55062b38a..9388ded03 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 @@ -61,6 +61,14 @@ function Get-MonoVersion { return "Mono $monoVersion" } +function Get-MsbuildVersion { + $msbuildVersion = msbuild -version | Select-Object -Last 1 + $result = Select-String -Path (Get-Command msbuild).Source -Pattern "msbuild" + $result -match "(?\/\S*\.dll)" | Out-Null + $msbuildPath = $Matches.path + return "MSBuild $msbuildVersion (from $msbuildPath)" +} + function Get-NodeVersion { $nodeVersion = $(node --version).Substring(1) return "Node $nodeVersion" diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index e597aa232..551569a1d 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -43,6 +43,7 @@ $markdown += New-MDList -Style Unordered -Lines (@( (Get-ClangFormatVersions), (Get-ErlangVersion), (Get-MonoVersion), + (Get-MsbuildVersion), (Get-NodeVersion), (Get-PerlVersion), (Get-PythonVersion), diff --git a/images/linux/scripts/tests/Tools.Tests.ps1 b/images/linux/scripts/tests/Tools.Tests.ps1 index 12d95b751..76f4ba4d3 100644 --- a/images/linux/scripts/tests/Tools.Tests.ps1 +++ b/images/linux/scripts/tests/Tools.Tests.ps1 @@ -150,6 +150,10 @@ Describe "Mono" { "mono --version" | Should -ReturnZeroExitCode } + It "msbuild" { + "msbuild -version" | Should -ReturnZeroExitCode + } + It "nuget" { "nuget" | Should -ReturnZeroExitCode }