1
0
mirror of https://github.com/fleschutz/PowerShell.git synced 2025-03-31 19:26:27 +02:00

Update earthquakes.ps1

This commit is contained in:
Markus Fleschutz 2020-12-14 20:36:44 +01:00 committed by GitHub
parent d66a10c6a2
commit a9666f482a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,12 +7,12 @@
# License: CC0
$Format="csv" # csv, geojson, kml, text, xml
$Order="time" # time, time-asc, magnitude, magnitude-asc
$MinMagnitude=6.0
$OrderBy="time" # time, time-asc, magnitude, magnitude-asc
try {
Write-Progress "Querying earthquakes for the last 30 days ..."
(Invoke-WebRequest -Uri "https://earthquake.usgs.gov/fdsnws/event/1/query?format=$Format&orderby=$Order&minmagnitude=$MinMagnitude" -UserAgent "curl" ).Content
(Invoke-WebRequest -Uri "https://earthquake.usgs.gov/fdsnws/event/1/query?format=$Format&minmagnitude=$MinMagnitude&orderby=$OrderBy" -UserAgent "curl" ).Content
exit 0
} catch {
Write-Error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"