From 4847468235952a25dde8734936b5502fe82c972a Mon Sep 17 00:00:00 2001 From: Mikhail Timofeev <48208649+miketimofeev@users.noreply.github.com> Date: Thu, 18 Mar 2021 09:41:01 +0300 Subject: [PATCH] Add Linux kernel version to software report (#2959) --- .../scripts/SoftwareReport/SoftwareReport.Generator.ps1 | 2 ++ images/linux/scripts/helpers/Common.Helpers.psm1 | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index e62c249be..ebf3fa439 100644 --- a/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/linux/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -26,7 +26,9 @@ $markdown = "" $OSName = Get-OSName $markdown += New-MDHeader "$OSName" -Level 1 +$kernelVersion = Get-KernelVersion $markdown += New-MDList -Style Unordered -Lines @( + "$kernelVersion" "Image Version: $env:IMAGE_VERSION" ) diff --git a/images/linux/scripts/helpers/Common.Helpers.psm1 b/images/linux/scripts/helpers/Common.Helpers.psm1 index bcb9a250d..04a79c46c 100644 --- a/images/linux/scripts/helpers/Common.Helpers.psm1 +++ b/images/linux/scripts/helpers/Common.Helpers.psm1 @@ -17,6 +17,11 @@ function Get-OSName { lsb_release -ds } +function Get-KernelVersion { + $kernelVersion = uname -r + return "Linux kernel version: $kernelVersion" +} + function Test-IsUbuntu16 { return (lsb_release -rs) -eq "16.04" }