IP Geolocation via Command Prompt\Powershell


  1. Posts : 2
    Windows 10 Pro
       #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 Computer


  2. Posts : 1
    Windows 10 Pro
       #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 Computer


  3. Posts : 2
    Windows 10 Pro
    Thread Starter
       #3

    Tanuki360 said:

    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 Computer


 

  Related Discussions
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 01:27.
Find Us




Windows 10 Forums