Windows 10: IP Geolocation via Command Prompt\Powershell

  1.    02 Sep 2016 #1

    IP Geolocation via Command Prompt\Powershell


    Hello,

    I'm looking for a way to check PC's IP Geolocation by using command prompt or powershell (no scripts).
    I hope there are some experts here who can help me out. I have found a very easy to do it on UNIX systems but my main machines will be Windows 7/8.1/10 based.

    Basically I need something equivalent to this: (This is via Terminal on MacOS)
    curl ipinfo.io
    {
    "ip": "793.452.666.321",
    "hostname": "athedsl-413388.home.otenet.gr",
    "city": "Athens",
    "region": "Attica",
    "country": "GR",
    "org": "AS6799 Ote SA (Hellenic Telecommunications Organisation)"


    Any suggestions?
      My ComputerSystem Spec

  2.    02 Sep 2016 #2

    PowerShell is not as different as you might think. That command "curl ipinfo.io" works right out of the box in PowerShell thanks to an alias command that maps to curl. PowerShell has several aliases for native commands to help make learning PowerShell easier for beginners. Curl is an alias for the PowerShell command Invoke-WebRequest. You can also use "iwr" as an alias. Now that PowerShell is available on Linux, though I would expect that the "curl" alias will be removed at some point so it is better to use the native syntax.

    If you want it to match the output of your example, you need to expand the content property of the returned object...

    curl ipinfo.io | select -ExpandProperty content

    This will return the exact same result as your example.
      My ComputerSystem Spec

  3.    02 Sep 2016 #3

    Tanuki360 said: View Post

    If you want it to match the output of your example, you need to expand the content property of the returned object...

    curl ipinfo.io | select -ExpandProperty content

    This will return the exact same result as your example.
    Tanuki, you have no idea how happy I am to finally get an answer, thank you so so so so much!!!!!!!!!
      My ComputerSystem Spec


 

Related Threads
Show Command Prompt or Windows PowerShell on Win+X menu in Windows 10 The Win+X Quick Link menu is a pop-up menu from the Start button that includes shortcuts of common management, configuration, and other power user Windows tools. This...
:really:I have a few PCs connected via a bridge on an ethernet LAN. They communicate with each other, not "the internet". I'd like to rename "Unidentified network" to something more reasonable like "DoNotTreadOnMe" (allegorical.) 76590
Solved Command Prompt in General Support
How to call up "command Prompt (Admin) from the "run" dialog box win 10 Home?
Command Prompt? in General Support
Guys, I'm going to try one last time. The error code I received told to me to empty files and then "Run the command prompt as an administrator"?? Then, type wuauclt.exe/update now??......I don't know what run the command prompt means. I have no...
Show Command Prompt or PowerShell in Win+X Power User Tasks Menu in Windows 10 This tutorial will show you how to have either the Command Prompt or Windows PowerShell items show in your Win+X Power User Tasks menu in Windows 10 ...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 09:46.
Find Us