Skip to content

Commit

Permalink
Update winfetch.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
kiedtl authored Apr 2, 2019
1 parent 09bc8f8 commit cda7b73
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/winfetch.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,20 @@ $mem_data = Get-Ciminstance Win32_OperatingSystem
$freemem = $mem_data.FreePhysicalMemory
[int]$totalmem = ($mem_data.TotalVisibleMemorySize) / 1024
[int]$usedmem = ($freemem - $totalmem) / 1024
$memory = "${usedmem}MiB / ${totalmem}MiB"

# ===== DISK USAGE =====

$disk_data = Get-Ciminstance Win32_LogicalDisk -Filter "DeviceID='C:'"
$freespace = $disk_data.FreeSpace
$disk_name = $disk_data.VolumeName
[int]$totalspace = ($disk_data.Size) / 1074000000
[int]$usedspace = ($freespace - $totalspace) / 1074000000
$disk = "${usedspace}GiB / ${totalspace}GiB (${disk_name})"

# ===== POWERSHELL VERSION =====
$pwsh_data = ($PSVersionTable.PSVersion).ToString()
$pwsh = "PowerShell v${pwsh_data}"

$memory = "${usedmem}MiB / ${totalmem}MiB"

# reset terminal sequences and display a newline
write-host "${e}[0m`n" -nonewline

Expand All @@ -135,6 +139,7 @@ $info.Add(@("Uptime", "$uptime"))
$info.Add(@("CPU", "$cpu"))
$info.Add(@("GPU", "$gpu"))
$info.Add(@("Memory", "$memory"))
$info.Add(@("Disk", "$disk"))
$info.Add(@("", ""))
$info.Add(@("", "$color_bar"))

Expand Down

0 comments on commit cda7b73

Please sign in to comment.