diff --git a/Scripts/check-drives.ps1 b/Scripts/check-drives.ps1 index ffb7c537..26a33771 100755 --- a/Scripts/check-drives.ps1 +++ b/Scripts/check-drives.ps1 @@ -1,21 +1,16 @@ <# .SYNOPSIS - Checks all drives for free space left + Checks the free space of all drives .DESCRIPTION This PowerShell script checks all drives for free space left (20 GB by default). -.PARAMETER MinLevel - Specifies the minimum level in Gigabyte .EXAMPLE PS> ./check-drives - ✔️ Drive C has 172GB left (233GB total) .LINK https://github.com/fleschutz/PowerShell .NOTES - Author: Markus Fleschutz / License: CC0 + Author: Markus Fleschutz | License: CC0 #> -param([int]$MinLevel = 20) # minimum level in GB - try { $Drives = Get-PSDrive -PSProvider FileSystem foreach($Drive in $Drives) { @@ -31,10 +26,10 @@ try { } else { $Reply = "Drive $($Drive.Name) has $($Free) GB left, $($Total) GB total." } - & "$PSScriptRoot/give-reply.ps1" "$Reply" + "* $Reply" } exit 0 # success } catch { "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" exit 1 -} +} \ No newline at end of file