Created
April 8, 2016 02:30
-
-
Save rayterrill/2d7b748000bbae90bedcdf60ef34b0a4 to your computer and use it in GitHub Desktop.
PowerShell - Get Current External IP Address
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#h/t: http://tfl09.blogspot.com/2008/07/finding-your-external-ip-address-with.html | |
function getCurrentExternalIPAddress() { | |
$wc=New-Object net.webclient | |
$wc.downloadstring("http://checkip.dyndns.com") -replace "[^\d\.]" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment