Google

Google API PowerShell Utilities

This repository contains 41 PowerShell entry-point scripts that use Google APIs to find nearby places or retrieve environmental conditions for the user’s current location. Shared request, validation, and response-handling logic lives in GoogleApiUtilities.psm1.

Script Categories

Category Scripts Description
General nearby places 12 Finds ATMs, airports, car rentals, embassies, hospitals, laundries, lodging, pharmacies, police stations, rail stations, restaurants, and transit services. These scripts are stored in the repository root and use the FindNearby*.ps1 naming pattern.
Cuisine and dining 24 Searches for nearby restaurants by cuisine or venue type, including American, Chinese, French, Greek, Indian, Italian, Japanese, Korean, Mediterranean, Mexican, Middle Eastern, seafood, Spanish, Thai, Turkish, and Vietnamese food, plus bars, coffee shops, fast food, pizza, steakhouses, sushi, vegan, and vegetarian options. These scripts are in Cuisines.
Arts and culture 3 Finds nearby art galleries, museums, and theaters. These scripts are in Cultures.
Environmental conditions 2 Retrieves current air-quality information and a one-day pollen forecast using GetAirQuality.ps1 and GetPollenData.ps1.

How the Scripts Work

Each script first uses the Google Geolocation API to determine approximate latitude and longitude. It then queries one of the following services and returns structured PowerShell objects that can be displayed, filtered, or exported:

API Keys

The scripts read Google API keys from environment variables rather than from files in the repository:

Environment variable Used for
GOOGLE_GEO_API_KEY Determining the current location; required by every script.
GOOGLE_PLACES_API_NEW_KEY Nearby-place, cuisine, and culture searches.
GOOGLE_AIR_QUALITY_API_KEY Air-quality conditions.
GOOGLE_POLLEN_API_KEY Pollen forecasts.

Set the required keys in the current PowerShell session before running a script. For example:

$env:GOOGLE_GEO_API_KEY = 'YOUR_GEOLOCATION_KEY'
$env:GOOGLE_PLACES_API_NEW_KEY = 'YOUR_PLACES_KEY'

Usage

PowerShell 5.1 or newer is required. Run any entry-point script directly:

./FindNearbyRestaurants.ps1
./Cuisines/FindItalianRest.ps1 -Radius 2500 -MaxResultCount 5
./GetAirQuality.ps1
./GetPollenData.ps1 -Days 3

Nearby-place scripts accept a radius from 1 through 50,000 meters and a result count from 1 through 20. The pollen script accepts 1 through 5 forecast days. Because the scripts emit objects, normal PowerShell pipelines work as expected:

./FindNearbyRestaurants.ps1 | Where-Object Rating -ge 4.5
./GetAirQuality.ps1 | ConvertTo-Json

Do not commit API keys or other credentials to the repository. Restrict each key in Google Cloud to only the APIs and environments that require it.

This is an independent project and is not affiliated with or endorsed by Google.