Updated some scripts

This commit is contained in:
Markus Fleschutz 2024-12-12 09:06:30 +01:00
parent 36f9723a1d
commit 1081db300f
3 changed files with 5 additions and 10 deletions

View File

@ -18,8 +18,8 @@
Write-Host "`n N E T W O R K" -foregroundColor green
& "$PSScriptRoot/check-firewall"
& "$PSScriptRoot/list-local-ip.ps1"
& "$PSScriptRoot/list-network-shares.ps1"
& "$PSScriptRoot/ping-local-devices.ps1"
& "$PSScriptRoot/list-network-shares.ps1"
& "$PSScriptRoot/check-vpn.ps1"
& "$PSScriptRoot/list-internet-ip.ps1"
& "$PSScriptRoot/ping-internet.ps1"

View File

@ -5,7 +5,7 @@
This PowerShell script lists all network shares (aka "shared folders") of the local computer.
.EXAMPLE
PS> ./list-network-shares.ps1
Network share \\LAPTOP\Public -> D:\Public ("Public folder for file transfer")
Shared folder \\LAPTOP\Public -> D:\Public ("Public folder for file transfer")
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -18,7 +18,7 @@ try {
} else {
$shares = Get-WmiObject win32_share | where {$_.name -NotLike "*$"}
foreach ($share in $shares) {
Write-Output "Network share \\$(hostname)\$($share.Name) -> $($share.Path) (`"$($share.Description)`")"
Write-Output "Shared folder \\$(hostname)\$($share.Name) -> $($share.Path) (`"$($share.Description)`")"
}
}
exit 0 # success

View File

@ -7,7 +7,7 @@
Specifies the hosts to ping, seperated by commata (10 Internet servers by default)
.EXAMPLE
PS> ./ping-internet.ps1
Internet ping takes 12ms (9...18ms range)
Internet ping: 12ms (9...18ms range)
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -39,12 +39,7 @@ try {
Write-Host "✅ Online with $loss/$total ping loss and $($min)...$($max)ms latency - $($speed)ms average"
} else {
[float]$speed = [math]::round([float]$avg / [float]$success, 1)
if ($speed -lt 20.0) { $result = "excellent"
} elseif ($speed -lt 50.0) { $result = "good"
} elseif ($speed -lt 100.0) { $result = "average"
} elseif ($speed -lt 150.0) { $result = "okay"
} else { $result = "laggy" }
Write-Host "✅ Internet ping is $($result): $($speed)ms ($($min)-$($max)ms range)"
Write-Host "✅ Internet ping: $($speed)ms ($min...$($max)ms range)"
}
exit 0 # success
} catch {