Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $webclient = New-Object System.Net.WebClient
- $location="Disney"
- Write-Output "Getting Address for $location"
- $url="https://maps.googleapis.com/maps/api/geocode/json?address=$location"
- $json=$webclient.DownloadString($url)
- [System.Reflection.Assembly]::LoadWithPartialName("System.Web.Extensions")
- $ser = New-Object System.Web.Script.Serialization.JavaScriptSerializer
- $obj = $ser.DeserializeObject($json)
- $item=$obj.Item("results")
- $line_break="==============================================\n";
- $first=$item.Get(0).formatted_address
- Write-Output "$line_break First Entry $first\n$line_break"
- Write-Output "$line_break All Entries\n$line_break"
- foreach($address in $item){
- $address.formatted_address
- }
Add Comment
Please, Sign In to add comment