Skip to content

Instantly share code, notes, and snippets.

@rayterrill
Created April 8, 2016 02:30
Show Gist options
  • Save rayterrill/2d7b748000bbae90bedcdf60ef34b0a4 to your computer and use it in GitHub Desktop.
Save rayterrill/2d7b748000bbae90bedcdf60ef34b0a4 to your computer and use it in GitHub Desktop.
PowerShell - Get Current External IP Address
#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