Skip to content

Instantly share code, notes, and snippets.

#One liner in which I use Invoke-Restmethod and select only the 4 properties keeping the output as an object for other operations
Invoke-RestMethod -Uri "www.telize.com/geoip" | Select-Object -Property longitude,latitude,continent_code,timezone
#Advanced function that just calls the above CmdLet
Function GetGeoInformation
{
Invoke-RestMethod -Uri "www.telize.com/geoip"
}
#Use the dvanced function by placing the results in a variable