Updated some scripts

This commit is contained in:
Markus Fleschutz 2024-01-27 09:55:14 +01:00
parent 1e227f3ba4
commit abb97e1c9f
4 changed files with 7 additions and 7 deletions

View File

@ -42,7 +42,7 @@ function GetCPUTemperature {
} }
try { try {
Write-Progress "Querying CPU status... " Write-Progress "Querying the CPU status... "
$status = "" $status = ""
$arch = GetCPUArchitecture $arch = GetCPUArchitecture
if ($IsLinux) { if ($IsLinux) {

View File

@ -7,8 +7,8 @@
Specifies the minimum warning level (10 GB by default) Specifies the minimum warning level (10 GB by default)
.EXAMPLE .EXAMPLE
PS> ./check-drives.ps1 PS> ./check-drives.ps1
Drive C: uses 49%, 512GB free of 1TB Drive C: uses 49% of 1TB · 512GB free
Drive D: uses 84%, 641GB free of 4TB Drive D: uses 84% of 4TB · 641GB free
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -51,7 +51,7 @@ try {
Write-Host "⚠️ Drive $name with $(Bytes2String $total) is nearly full, $(Bytes2String $free) free" Write-Host "⚠️ Drive $name with $(Bytes2String $total) is nearly full, $(Bytes2String $free) free"
} else { } else {
[int]$percent = ($used * 100) / $total [int]$percent = ($used * 100) / $total
Write-Host "✅ Drive $name uses $percent%, $(Bytes2String $free) free of $(Bytes2String $total)" Write-Host "✅ Drive $name uses $percent% of $(Bytes2String $total) · $(Bytes2String $free) free"
} }
} }
exit 0 # success exit 0 # success

View File

@ -21,6 +21,6 @@
& "$PSScriptRoot/check-ram.ps1" & "$PSScriptRoot/check-ram.ps1"
& "$PSScriptRoot/check-gpu.ps1" & "$PSScriptRoot/check-gpu.ps1"
& "$PSScriptRoot/check-smart-devices.ps1" & "$PSScriptRoot/check-smart-devices.ps1"
& "$PSScriptRoot/check-drives.ps1"
& "$PSScriptRoot/check-power.ps1" & "$PSScriptRoot/check-power.ps1"
& "$PSScriptRoot/check-drives.ps1"
exit 0 # success exit 0 # success

View File

@ -7,7 +7,7 @@
Specifies the minimum level in GB (10 GB by default) Specifies the minimum level in GB (10 GB by default)
.EXAMPLE .EXAMPLE
PS> ./check-swap-space.ps1 PS> ./check-swap-space.ps1
Swap space uses 42%, 748MB free of 1GB Swap space uses 42% of 1GB · 748MB free
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -53,7 +53,7 @@ try {
Write-Output "✅ Swap space unused, $(MB2String $Free) free" Write-Output "✅ Swap space unused, $(MB2String $Free) free"
} else { } else {
[int]$Percent = ($Used * 100) / $Total [int]$Percent = ($Used * 100) / $Total
Write-Output "✅ Swap space uses $Percent%, $(MB2String $Free) free of $(MB2String $Total)" Write-Output "✅ Swap space uses $Percent% of $(MB2String $Total) · $(MB2String $Free) free"
} }
exit 0 # success exit 0 # success
} catch { } catch {