mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-07-07 08:00:06 +02:00
Update check-drive-space.ps1
This commit is contained in:
@ -13,9 +13,8 @@ if ($Drive -eq "" ) {
|
||||
}
|
||||
|
||||
try {
|
||||
$FreeSpace = (get-psdrive $Drive).free
|
||||
if ($lastExitCode -ne "0") { throw "'get-psdrive $Drive' failed" }
|
||||
[int]$FreeSpace = (($FreeSpace / 1024) / 1024) / 1024
|
||||
$FreeSpace = (get-psdrive $Drive)
|
||||
[int]$FreeSpace = (($FreeSpace.free / 1024) / 1024) / 1024
|
||||
|
||||
if ($FreeSpace -lt $WarningLevel) {
|
||||
write-warning "Drive $Drive has only $FreeSpace GB free space left! (warning level is < $WarningLevel GB)"
|
||||
|
Reference in New Issue
Block a user