Skip to content

Instantly share code, notes, and snippets.

@veritas06
Created August 7, 2018 17:54
Show Gist options
  • Save veritas06/1e87b9f52eb464da2ca6038aad5d1687 to your computer and use it in GitHub Desktop.
Save veritas06/1e87b9f52eb464da2ca6038aad5d1687 to your computer and use it in GitHub Desktop.
[PS: Get External IP] PowerShell command to get a user's external IP #PowerShell #IP
# Microsoft TechNet: PowerShell One Liner: Get External/Public IP Address
# https://gallery.technet.microsoft.com/scriptcenter/Get-ExternalPublic-IP-c1b601bb
$ip = Invoke-RestMethod http://ipinfo.io/json | Select -exp ip
$ipinfo = Invoke-RestMethod http://ipinfo.io/json
$ipinfo.ip
$ipinfo.hostname
$ipinfo.city
$ipinfo.region
$ipinfo.country
$ipinfo.loc
$ipinfo.org
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment