Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@p0w3rsh3ll
Created August 15, 2015 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save p0w3rsh3ll/ab36a6a1629fa01988f2 to your computer and use it in GitHub Desktop.
Save p0w3rsh3ll/ab36a6a1629fa01988f2 to your computer and use it in GitHub Desktop.
#requires -version 2.0
$o = New-Object -TypeName psobject
$raw = (New-Object Net.WebClient).DownloadString('http://www.telize.com/geoip')
$raw -split',' | ForEach-Object {
$r = ([regex]'{?"(?<property>.*)":"?(?<value>[a-zA-Z_0-9\.\s\\/]*)"?}?$').Matches($_) |
Select -Expand Groups | Select -Last 2 -Property Value
$o | Add-Member -Type NoteProperty -Name $(($r[0]).Value) -Value $(($r[1]).Value) -Force
}
$o | Format-Table -Property *tude,con*,t*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment