Would you like to know where a public IP address is located? Provided you have Internet access, you can query one of the public information services.
This example gets you the geolocation of an IP address. Make sure you replace the sample IP address with your own publicly exposed IP address. Go to websites like https://www.whatismyip.com/ to find out your IP address. If you use a private IP address, the web service cannot report back any geo location data obviously.
#requires -Version 3 $ipaddress = '220.127.116.11' $infoService = "http://freegeoip.net/xml/$ipaddress" $geoip = Invoke-RestMethod -Method Get -URI $infoService $geoip.Response