Add kernel suppport

This commit is contained in:
Rashil Gandhi
2021-01-06 13:40:46 +05:30
parent e6a2b852db
commit cd25319fc5
2 changed files with 18 additions and 3 deletions
+1
View File
@@ -19,6 +19,7 @@
"dashes"
"os"
"computer"
"kernel"
# "custom_time" # use custom info line
"uptime"
"pkgs"
+17 -3
View File
@@ -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)"
}
}