mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-08 09:04:18 +01:00
Added weather-report.ps1
This commit is contained in:
parent
8d75ac7b02
commit
8d73400475
@ -36,6 +36,7 @@ The following PowerShell scripts can be found in the `Scripts/` subfolder:
|
|||||||
* [txt2wav.ps1](Scripts/txt2wav.ps1) - converts text into a audio .WAV file
|
* [txt2wav.ps1](Scripts/txt2wav.ps1) - converts text into a audio .WAV file
|
||||||
* [validate-xml.ps1](Scripts/validate-xml.ps1) - validates the given XML file
|
* [validate-xml.ps1](Scripts/validate-xml.ps1) - validates the given XML file
|
||||||
* [weather.ps1](Scripts/weather.ps1) - prints the current weather forecast
|
* [weather.ps1](Scripts/weather.ps1) - prints the current weather forecast
|
||||||
|
* [weather-report.ps1](Scripts/weather-report.ps1) - prints the local weather report
|
||||||
* [weather-worldwide.ps1](Scripts/weather-worldwide.ps1) - prints the current weather of cities world-wide
|
* [weather-worldwide.ps1](Scripts/weather-worldwide.ps1) - prints the current weather of cities world-wide
|
||||||
* [wakeup.ps1](Scripts/wakeup.ps1) - sends a magic packet to the given computer, waking him up
|
* [wakeup.ps1](Scripts/wakeup.ps1) - sends a magic packet to the given computer, waking him up
|
||||||
* [zipdir.ps1](Scripts/zipdir.ps1) - creates a zip archive of the given folder
|
* [zipdir.ps1](Scripts/zipdir.ps1) - creates a zip archive of the given folder
|
||||||
|
15
Scripts/weather-report.ps1
Executable file
15
Scripts/weather-report.ps1
Executable file
@ -0,0 +1,15 @@
|
|||||||
|
#!/snap/bin/powershell
|
||||||
|
|
||||||
|
# Syntax: ./weather-report.ps1
|
||||||
|
# Description: prints the local weather report
|
||||||
|
# Author: Markus Fleschutz
|
||||||
|
# Source: github.com/fleschutz/PowerShell
|
||||||
|
# License: CC0
|
||||||
|
|
||||||
|
$GeoLocation="" # empty means determine automatically
|
||||||
|
|
||||||
|
try {
|
||||||
|
(Invoke-WebRequest http://v2d.wttr.in/$GeoLocation -UserAgent "curl" ).Content
|
||||||
|
exit 0
|
||||||
|
} catch { Write-Error $Error[0] }
|
||||||
|
exit 1
|
Loading…
Reference in New Issue
Block a user