Update list-public-ip.ps1 and ping-local-hosts.ps1

This commit is contained in:
Markus Fleschutz 2024-02-13 20:14:48 +01:00
parent 7d36c0fb74
commit e993d937d6
2 changed files with 4 additions and 4 deletions

View File

@ -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])"

View File

@ -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 {