I am doing a project which needs to calculate the distance between different cities in the world. I think there is a way with google maps, but I do not know how to use it within PowerShell.
I found something new from Get location (lat/long) from googlemap with address - Using powershell.
The answer to that question is quite useful, but the coordinates I got can't be directly used to calculate the distance.
I've tried to use
Cannot convert the "System.Decimal" value of type "System.RuntimeType" to type "System.Double".
To answer the conversion part of this question (using the example from the other question you referenced), the following will give you a decimal variable:
$lat = $json.results.geometry.location.lat
This will convert it to a double (for example):
$lat = [double]$json.results.geometry.location.lat