Skip to content

Commit

Permalink
Update check-drive-space.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
fleschutz authored Mar 2, 2021
1 parent 41c83f9 commit ffd527d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Scripts/check-drive-space.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down

0 comments on commit ffd527d

Please sign in to comment.