1. Joined : Sep 2016
    Posts : 2
    Windows 10 Pro
       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 System SpecsSystem Spec


  2. Joined : Sep 2016
    Posts : 1
    Windows 10 Pro
       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 System SpecsSystem Spec


  3. Joined : Sep 2016
    Posts : 2
    Windows 10 Pro
       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 System SpecsSystem Spec


 


Similar Threads
Thread Forum
Win+X Menu - Show Command Prompt or PowerShell in Windows 10
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...
Tutorials
What powershell command will let me rename my network?
: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
Network and Sharing
Solved Command Prompt
How to call up "command Prompt (Admin) from the "run" dialog box win 10 Home?
General Support
Command Prompt?
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...
General Support
Change Default Command Prompt to Powershell
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 ...
Chillout Room
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 08:38.
Find Us
Twitter Facebook Google+



Windows 10 Forums