Updated weather-worldwide.ps1

This commit is contained in:
Markus Fleschutz 2020-12-13 11:57:35 +00:00
parent 69c8c48203
commit a207a927c2

View File

@ -9,11 +9,14 @@
$Cities="Hawaii","Los Angeles","Mexico City","Miami","New York","Rio de Janeiro","Paris","London","Berlin","Cape Town","Dubai","Mumbai","Singapore","Hong Kong","Peking","Tokyo","Sydney"
try {
write-host "Current Weather Report World-wide"
write-host "================================="
write-output "Current Weather Report World-wide"
write-output "================================="
write-output ""
foreach($City in $Cities) {
(Invoke-WebRequest http://wttr.in/${City}?format="* %l:+%c+%t+%p+%h+%P+%w +%S ->+%s" -UserAgent "curl" ).Content
$Line = (Invoke-WebRequest http://wttr.in/${City}?format="%l:+%c+%t+%p+%h+%P+%w +%S ->+%s" -UserAgent "curl").Content
write-output "* $Line"
}
write-output ""
exit 0
} catch {
Write-Error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"