Update check-cpu.ps1 and check-ping.ps1

This commit is contained in:
Markus Fleschutz 2023-03-16 16:36:58 +01:00
parent ebe50ff58e
commit be11d8650e
2 changed files with 2 additions and 3 deletions

View File

@ -74,8 +74,8 @@ try {
$Socket = "$($Details.SocketDesignation) socket, "
}
$Cores = [System.Environment]::ProcessorCount
Write-Progress -completed "done."
Write-Host "$Status $CPUName ($Cores cores, $($DeviceID)$($Speed)$($Socket)$Temp)"
Write-Progress -completed "Querying CPU details finished."
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -20,6 +20,7 @@ try {
Write-Progress "⏳ Sending a ping to 9 popular hosts..."
$HostsArray = $hosts.Split(",")
$Pings = Test-Connection -computerName $HostsArray -count 1
Write-Progress -Completed "."
[int]$Min = 9999999
[int]$Max = [int]$Avg = 0
@ -30,8 +31,6 @@ try {
$Avg += $Latency
}
$Avg /= $Pings.count
Write-Progress -Completed "."
Write-Host "✅ Ping latency is $($Min)ms...$($Max)ms, $($Avg)ms average"
exit 0 # success
} catch {