mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-27 10:23:17 +01:00
Update check-drive-space.ps1
This commit is contained in:
parent
41c83f9ec0
commit
ffd527dbe2
@ -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)"
|
||||
|
Loading…
Reference in New Issue
Block a user