mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-28 23:56:52 +01:00
Update check-ip.ps1
This commit is contained in:
parent
6b05584fac
commit
2a115dce0a
@ -5,7 +5,7 @@
|
|||||||
This PowerShell script queries the public IP address and prints it.
|
This PowerShell script queries the public IP address and prints it.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./check-ip.ps1
|
PS> ./check-ip.ps1
|
||||||
✅ Public IPv4 185.77.209.161, IPv6 2003:f2:6128:fc01:e503:601:30c2:a028, near Munich
|
✅ Public IPv4 185.77.209.161, IPv6 2003:f2:6128:fc01:e503:601:30c2:a028 near Munich
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
.NOTES
|
.NOTES
|
||||||
@ -22,7 +22,7 @@ try {
|
|||||||
$PublicIPv6 = (curl.exe -6 --silent ifconfig.co)
|
$PublicIPv6 = (curl.exe -6 --silent ifconfig.co)
|
||||||
$City = (curl.exe --silent ifconfig.co/city)
|
$City = (curl.exe --silent ifconfig.co/city)
|
||||||
}
|
}
|
||||||
Write-Output "✅ Public IPv4 $PublicIPv4, IPv6 $PublicIPv6, near $City"
|
Write-Output "✅ Public IPv4 $PublicIPv4, IPv6 $PublicIPv6 near $City"
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user