mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-23 14:18:38 +01:00
Updated check-dns.ps1 and list-network-shares.ps1
This commit is contained in:
parent
5214a504db
commit
3ae015a752
@ -5,7 +5,7 @@
|
||||
This PowerShell script measures the DNS resolution speed using 100 internet domains and prints it.
|
||||
.EXAMPLE
|
||||
PS> ./check-dns.ps1
|
||||
✅ Internet DNS resolves 56.5 domains/sec
|
||||
✅ Internet DNS queries take 33.6ms
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@ -25,9 +25,9 @@ try {
|
||||
[float]$elapsed = $stopWatch.Elapsed.TotalSeconds * 1000.0
|
||||
$speed = [math]::round($elapsed / $table.Length, 1)
|
||||
if ($speed -gt 100.0) {
|
||||
Write-Host "⚠️ Internet DNS query time $($speed)ms only"
|
||||
Write-Host "⚠️ Internet DNS queries are $($speed)ms slow"
|
||||
} else {
|
||||
Write-Host "✅ Internet DNS query time $($speed)ms"
|
||||
Write-Host "✅ Internet DNS queries take $($speed)ms"
|
||||
}
|
||||
exit 0 # success
|
||||
} catch {
|
||||
|
@ -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 mapped to: 📂D:\Public ("Public folder for file transfer")
|
||||
✅ Network share \\LAPTOP\Public ("Public folder for file transfer") mapped to: 📂D:\Public
|
||||
.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) mapped to: 📂$($share.Path) (`"$($share.Description)`")"
|
||||
Write-Output "✅ Network share \\$(hostname)\$($share.Name) (`"$($share.Description)`") mapped to: 📂$($share.Path)"
|
||||
}
|
||||
}
|
||||
exit 0 # success
|
||||
|
Loading…
Reference in New Issue
Block a user