mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-11 02:54:49 +02: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]$Used = (($DriveDetails.Used / 1024) / 1024) / 1024
|
||||||
[int]$Total = ($Used + $Free)
|
[int]$Total = ($Used + $Free)
|
||||||
|
|
||||||
if ($Free -lt $MinLevel) {
|
if ($Total -eq "0") {
|
||||||
$Reply = "Drive $($Drive.Name) has only $Free GB left to use! ($Used of $Total GB used, minimum is $MinLevel GB)"
|
$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 {
|
} 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"
|
& "$PSScriptRoot/give-reply.ps1" "$Reply"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user