Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$Locations = ForEach ($Addr in ($Data | ConvertFrom-Csv ))
{ $Addr.Address = $Addr.Address -replace " ","+"
$Location = Invoke-RestMethod -uri "http://maps.googleapis.com/maps/api/geocode/json?address=$($Addr.Address)&sensor=false"
[PSCustomObject]@{
Place = $Addr.Place
Location = $Location.Results.Formatted_Address
Lat = $Location.Results.Geometry.Location.Lat
Lng = $Location.Results.Geometry.Location.Lng
Item = $Addr.Item
Qty = $Addr.Qty
Tot = $Addr.Tot
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment