diff --git a/lib/config.ps1 b/lib/config.ps1 index 0b0f25d..d1d50e5 100644 --- a/lib/config.ps1 +++ b/lib/config.ps1 @@ -19,6 +19,7 @@ "dashes" "os" "computer" + "kernel" # "custom_time" # use custom info line "uptime" "pkgs" diff --git a/src/posh-winfetch.ps1 b/src/posh-winfetch.ps1 index 2b7be33..86e8d51 100644 --- a/src/posh-winfetch.ps1 +++ b/src/posh-winfetch.ps1 @@ -113,6 +113,7 @@ $baseConfig = @( "dashes" "os" "computer" + "kernel" "uptime" "pkgs" "pwsh" @@ -236,8 +237,8 @@ function info_os { return @{ title = "OS" content = if ($IsWindows -or $PSVersionTable.PSVersion.Major -eq 5) { - $os = Get-CimInstance -ClassName Win32_OperatingSystem -Property Caption,OSArchitecture,Version -CimSession $cimSession - "$($os.Caption.TrimStart('Microsoft ')) [$($os.OSArchitecture)] ($($os.Version))" + $os = Get-CimInstance -ClassName Win32_OperatingSystem -Property Caption,OSArchitecture -CimSession $cimSession + "$($os.Caption.TrimStart('Microsoft ')) [$($os.OSArchitecture)]" } else { ($PSVersionTable.OS).TrimStart('Microsoft ') } @@ -274,6 +275,19 @@ function info_computer { } +# ===== KERNEL ===== +function info_kernel { + return @{ + title = "Kernel" + content = if ($IsWindows -or $PSVersionTable.PSVersion.Major -eq 5) { + "$([System.Environment]::OSVersion.Version)" + } else { + "$(uname -r)" + } + } +} + + # ===== UPTIME ===== function info_uptime { @{ @@ -369,7 +383,7 @@ function info_disk { # ===== POWERSHELL VERSION ===== function info_pwsh { return @{ - title = "PowerShell" + title = "Shell" content = "PowerShell v$($PSVersionTable.PSVersion)" } }