mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-02 10:59:14 +01:00
Improved some scripts
This commit is contained in:
parent
a316ad6e27
commit
513c60d5f9
@ -48,7 +48,7 @@ try {
|
||||
} elseif ($free -lt $minLevel) {
|
||||
Write-Host "⚠️ Drive $driveName with $(Bytes2String $total) is nearly full, $(Bytes2String $free) free"
|
||||
} else {
|
||||
[int]$percent = ($used * 100) / $total
|
||||
[int64]$percent = ($used * 100) / $total
|
||||
Write-Host "✅ Drive $driveName has $(Bytes2String $free) free ($percent% of $(Bytes2String $total) used)"
|
||||
}
|
||||
exit 0 # success
|
||||
|
@ -45,7 +45,7 @@ try {
|
||||
} elseif ($free -lt $minLevel) {
|
||||
Write-Host "⚠️ Drive $name with $(Bytes2String $total) is nearly full, $(Bytes2String $free) free"
|
||||
} else {
|
||||
[int]$percent = ($used * 100) / $total
|
||||
[int64]$percent = ($used * 100) / $total
|
||||
Write-Host "✅ Drive $name has $(Bytes2String $free) free ($percent% of $(Bytes2String $total) used)"
|
||||
}
|
||||
}
|
||||
|
@ -54,8 +54,8 @@ try {
|
||||
} elseif ($used -lt 5) {
|
||||
Write-Output "✅ Swap space has the full $(MB2String $free) free"
|
||||
} else {
|
||||
[int]$Percent = ($used * 100) / $total
|
||||
Write-Output "✅ Swap space has $(MB2String $free) free ($Percent% of $(MB2String $total) used)"
|
||||
[int64]$percent = ($used * 100) / $total
|
||||
Write-Output "✅ Swap space has $(MB2String $free) free ($percent% of $(MB2String $total) used)"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
|
Loading…
Reference in New Issue
Block a user