mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-22 20:51:17 +01:00
Improved both scripts
This commit is contained in:
parent
c297f70046
commit
b4ba271ff2
@ -8,8 +8,8 @@
|
||||
|
||||
try {
|
||||
if (test-path "/sys/class/thermal/thermal_zone0/temp") {
|
||||
$Temp = get-content "/sys/class/thermal/thermal_zone0/temp"
|
||||
$Temp = $Temp / 1000.0
|
||||
[int]$IntTemp = get-content "/sys/class/thermal/thermal_zone0/temp"
|
||||
$Temp = [math]::round($IntTemp / 1000.0, 1)
|
||||
} else {
|
||||
write-warning "Sorry, no CPU temperature available"
|
||||
exit 0
|
||||
@ -26,7 +26,7 @@ try {
|
||||
} elseif ($Temp -lt "0") {
|
||||
write-warning "CPU has $Temp °C - quite low"
|
||||
} else {
|
||||
write-host -foregroundColor green "OK - CPU has $Temp °C"
|
||||
write-host -foregroundColor green "OK - $Temp °C CPU temperature"
|
||||
}
|
||||
exit 0
|
||||
} catch {
|
||||
|
@ -21,7 +21,8 @@ try {
|
||||
$Count = $Table.Length
|
||||
$StopTime = Get-Date
|
||||
$TimeInterval = New-Timespan -start $StartTime -end $StopTime
|
||||
write-host -foregroundColor green "OK - resolved $Count domain names in $($TimeInterval.seconds) seconds"
|
||||
$Average = [math]::round($Count / $TimeInterval.seconds, 1)
|
||||
write-host -foregroundColor green "OK - $Average domains/s ($Count domains resolved in $($TimeInterval.seconds) seconds)"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Loading…
Reference in New Issue
Block a user