From 608520576400408b5d8799844e91ca6192d42708 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Mon, 14 Oct 2024 12:34:18 +0000 Subject: [PATCH] Updated check-drives.ps1 --- scripts/check-drives.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/check-drives.ps1 b/scripts/check-drives.ps1 index 1b36d374..7fd7989f 100755 --- a/scripts/check-drives.ps1 +++ b/scripts/check-drives.ps1 @@ -4,7 +4,7 @@ .DESCRIPTION This PowerShell script queries the free space of all drives and prints it. .PARAMETER minLevel - Specifies the minimum warning level (10GB by default) + Specifies the minimum warning level (5GB by default) .EXAMPLE PS> ./check-drives.ps1 ✅ Drive C: uses 489GB (53%) of 930GB, D: uses 3TB (87%) of 4TB, E: is empty @@ -14,7 +14,7 @@ Author: Markus Fleschutz | License: CC0 #> -param([int64]$minLevel = 10GB) +param([int64]$minLevel = 5GB) function Bytes2String { param([int64]$bytes) if ($bytes -lt 1KB) { return "$bytes bytes" } @@ -45,7 +45,7 @@ try { $reply += "$name with ($(Bytes2String $total)) is FULL" } elseif ($free -lt $minLevel) { $status = "⚠️" - $reply += "$name is nearly full ($(Bytes2String $free) of $(Bytes2String $total) left)" + $reply += "$name nearly full ($(Bytes2String $free) of $(Bytes2String $total) left)" } else { [int64]$percent = ($used * 100) / $total $reply += "$name uses $(Bytes2String $used) ($percent%) of $(Bytes2String $total)"