mirror of
https://github.com/lptstr/winfetch.git
synced 2026-08-28 18:24:25 -05:00
Add kernel suppport
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
"dashes"
|
||||
"os"
|
||||
"computer"
|
||||
"kernel"
|
||||
# "custom_time" # use custom info line
|
||||
"uptime"
|
||||
"pkgs"
|
||||
|
||||
+17
-3
@@ -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)"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user