mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-30 15:08:49 +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
|
.SYNOPSIS
|
||||||
Lists the public IP address information
|
Lists the public IP address
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This PowerShell script queries the public IP address information and prints it.
|
This PowerShell script queries the public IP address information and prints it.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./list-public-ip.ps1
|
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
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -28,7 +28,7 @@ try {
|
|||||||
if ("$publicIPv6" -eq "") { $publicIPv6 = "no IPv6" }
|
if ("$publicIPv6" -eq "") { $publicIPv6 = "no IPv6" }
|
||||||
if ("$city" -eq "") { $city = "unknown city" }
|
if ("$city" -eq "") { $city = "unknown city" }
|
||||||
if ("$country" -eq "") { $country = "unknown country" }
|
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
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -40,7 +40,7 @@ try {
|
|||||||
$queue.Enqueue($obj)
|
$queue.Enqueue($obj)
|
||||||
} while ($queue.Count -gt 0)
|
} while ($queue.Count -gt 0)
|
||||||
|
|
||||||
Write-Progress -completed "Done."
|
Write-Progress -completed "done."
|
||||||
Write-Host "✅ Up: $($up)"
|
Write-Host "✅ Up: $($up)"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user