Added try and catch

This commit is contained in:
Markus Fleschutz
2020-10-05 13:12:12 +02:00
parent 14ab054646
commit 847be37772
25 changed files with 199 additions and 110 deletions

View File

@ -6,5 +6,8 @@
# Source: github.com/fleschutz/PowerShell
# License: CC0
(Invoke-WebRequest http://wttr.in/Moon -UserAgent "curl" ).Content
exit 0
try {
(Invoke-WebRequest http://wttr.in/Moon -UserAgent "curl" ).Content
exit 0
} catch { Write-Error $Error[0] }
exit 1