mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-22 20:51:17 +01:00
Update check-drives.ps1
This commit is contained in:
parent
8301a63a6a
commit
7aa7af1028
@ -24,10 +24,12 @@ try {
|
||||
[int]$Used = (($DriveDetails.Used / 1024) / 1024) / 1024
|
||||
[int]$Total = ($Used + $Free)
|
||||
|
||||
if ($Free -lt $MinLevel) {
|
||||
$Reply = "Drive $($Drive.Name) has only $Free GB left to use! ($Used of $Total GB used, minimum is $MinLevel GB)"
|
||||
if ($Total -eq "0") {
|
||||
$Reply = "Drive $($Drive.Name) is empty."
|
||||
} elseif ($Free -lt $MinLevel) {
|
||||
$Reply = "Drive $($Drive.Name) has only $Free GB left to use! $Used of $Total GB is in use."
|
||||
} else {
|
||||
$Reply = "Drive $($Drive.Name) has $($Free)GB left ($($Total)GB total)"
|
||||
$Reply = "Drive $($Drive.Name) has $($Free) GB left, $($Total) GB total."
|
||||
}
|
||||
& "$PSScriptRoot/give-reply.ps1" "$Reply"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user