mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-29 11:24:27 +01:00
Update check-cpu.ps1 and check-ping.ps1
This commit is contained in:
parent
ebe50ff58e
commit
be11d8650e
@ -74,8 +74,8 @@ try {
|
|||||||
$Socket = "$($Details.SocketDesignation) socket, "
|
$Socket = "$($Details.SocketDesignation) socket, "
|
||||||
}
|
}
|
||||||
$Cores = [System.Environment]::ProcessorCount
|
$Cores = [System.Environment]::ProcessorCount
|
||||||
|
Write-Progress -completed "done."
|
||||||
Write-Host "$Status $CPUName ($Cores cores, $($DeviceID)$($Speed)$($Socket)$Temp)"
|
Write-Host "$Status $CPUName ($Cores cores, $($DeviceID)$($Speed)$($Socket)$Temp)"
|
||||||
Write-Progress -completed "Querying CPU details finished."
|
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -20,6 +20,7 @@ try {
|
|||||||
Write-Progress "⏳ Sending a ping to 9 popular hosts..."
|
Write-Progress "⏳ Sending a ping to 9 popular hosts..."
|
||||||
$HostsArray = $hosts.Split(",")
|
$HostsArray = $hosts.Split(",")
|
||||||
$Pings = Test-Connection -computerName $HostsArray -count 1
|
$Pings = Test-Connection -computerName $HostsArray -count 1
|
||||||
|
Write-Progress -Completed "."
|
||||||
|
|
||||||
[int]$Min = 9999999
|
[int]$Min = 9999999
|
||||||
[int]$Max = [int]$Avg = 0
|
[int]$Max = [int]$Avg = 0
|
||||||
@ -30,8 +31,6 @@ try {
|
|||||||
$Avg += $Latency
|
$Avg += $Latency
|
||||||
}
|
}
|
||||||
$Avg /= $Pings.count
|
$Avg /= $Pings.count
|
||||||
|
|
||||||
Write-Progress -Completed "."
|
|
||||||
Write-Host "✅ Ping latency is $($Min)ms...$($Max)ms, $($Avg)ms average"
|
Write-Host "✅ Ping latency is $($Min)ms...$($Max)ms, $($Avg)ms average"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
|
Loading…
Reference in New Issue
Block a user