From c45b5f5b6f8c7aadcfbe9b40fecbd80349c585d5 Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev <50947177+Darleev@users.noreply.github.com> Date: Thu, 3 Dec 2020 12:35:46 +0700 Subject: [PATCH] [Ubuntu] Powershell Tools/Modules software report. (#2164) * added new tables to ubuntu generation. * changes applied * removed powershell version --- .../SoftwareReport/SoftwareReport.Common.psm1 | 15 +++++++++++++++ .../SoftwareReport/SoftwareReport.Generator.ps1 | 8 +++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 index 15a19653c..462be1fbc 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Common.psm1 @@ -228,6 +228,21 @@ function Get-AzModuleVersions { return $azModuleVersions } +function Get-PowerShellModules { + $modules = (Get-ToolsetContent).powershellModules.name + + $psModules = Get-Module -Name $modules -ListAvailable | Sort-Object Name | Group-Object Name + $psModules | ForEach-Object { + $moduleName = $_.Name + $moduleVersions = ($_.group.Version | Sort-Object -Unique) -join '
' + + [PSCustomObject]@{ + Module = $moduleName + Version = $moduleVersions + } + } +} + function Get-DotNetCoreSdkVersions { $unsortedDotNetCoreSdkVersion = dotnet --list-sdks list | ForEach-Object { $_ | Take-OutputPart -Part 0 } $dotNetCoreSdkVersion = $unsortedDotNetCoreSdkVersion -join " " diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 84225865a..a5e71b1db 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -40,7 +40,6 @@ $markdown += New-MDList -Style Unordered -Lines @( (Get-NodeVersion), (Get-PythonVersion), (Get-Python3Version), - (Get-PowershellVersion), (Get-RubyVersion), (Get-SwiftVersion), (Get-JuliaVersion) @@ -213,6 +212,13 @@ $markdown += Build-MSSQLToolsSection $markdown += New-MDHeader "Cached Tools" -Level 3 $markdown += Build-CachedToolsSection +$markdown += New-MDHeader "PowerShell Tools" -Level 3 +$markdown += New-MDList -Lines (Get-PowershellVersion) -Style Unordered + +$markdown += New-MDHeader "PowerShell Modules" -Level 4 +$markdown += Get-PowerShellModules | New-MDTable +$markdown += New-MDNewLine + $markdown += New-MDHeader "Android" -Level 3 $markdown += Build-AndroidTable | New-MDTable $markdown += New-MDNewLine