mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-09 18:19:32 +02:00
Update earthquakes.ps1
This commit is contained in:
parent
d66a10c6a2
commit
a9666f482a
@ -7,12 +7,12 @@
|
|||||||
# License: CC0
|
# License: CC0
|
||||||
|
|
||||||
$Format="csv" # csv, geojson, kml, text, xml
|
$Format="csv" # csv, geojson, kml, text, xml
|
||||||
$Order="time" # time, time-asc, magnitude, magnitude-asc
|
|
||||||
$MinMagnitude=6.0
|
$MinMagnitude=6.0
|
||||||
|
$OrderBy="time" # time, time-asc, magnitude, magnitude-asc
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Write-Progress "Querying earthquakes for the last 30 days ..."
|
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
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
Write-Error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
Write-Error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user