mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-01 03:36:28 +02:00
Update list-public-ip.ps1 and ping-local-hosts.ps1
This commit is contained in:
parent
7d36c0fb74
commit
e993d937d6
@ -1,11 +1,11 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Lists the public IP address information
|
||||
Lists the public IP address
|
||||
.DESCRIPTION
|
||||
This PowerShell script queries the public IP address information and prints it.
|
||||
.EXAMPLE
|
||||
PS> ./list-public-ip.ps1
|
||||
✅ Public IP address 185.72.229.161, 2003:f2:6128:fc01:e543:601:30c2:a028 near Munich, Germany
|
||||
✅ Public IP address 185.72.229.161, 2003:f2:6128:fd01:e543:601:30c2:a028 near Munich, Germany
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
@ -28,7 +28,7 @@ try {
|
||||
if ("$publicIPv6" -eq "") { $publicIPv6 = "no IPv6" }
|
||||
if ("$city" -eq "") { $city = "unknown city" }
|
||||
if ("$country" -eq "") { $country = "unknown country" }
|
||||
Write-Output "✅ Public IP address $publicIPv4, $publicIPv6 near $city, $country" ; if ($country -eq "Russia") { Write-Host -foregroundColor red "DON'T TRUST PUTIN !!! FLEE NOW OR DIE AS SOLDIER IN UKRAINE !!!" }
|
||||
Write-Host "✅ Public IP address $publicIPv4, $publicIPv6 near $city, $country" ; if ($country -eq "Russia") { Write-Host -foregroundColor red "DON'T TRUST PUTIN !!! FLEE NOW OR DIE AS SOLDIER IN UKRAINE !!!" }
|
||||
exit 0 # success
|
||||
} catch {
|
||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
@ -40,7 +40,7 @@ try {
|
||||
$queue.Enqueue($obj)
|
||||
} while ($queue.Count -gt 0)
|
||||
|
||||
Write-Progress -completed "Done."
|
||||
Write-Progress -completed "done."
|
||||
Write-Host "✅ Up: $($up)"
|
||||
exit 0 # success
|
||||
} catch {
|
||||
|
Loading…
Reference in New Issue
Block a user