From a207a927c211bd6a85ec6855ba8533a6fd332d0a Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Sun, 13 Dec 2020 11:57:35 +0000 Subject: [PATCH] Updated weather-worldwide.ps1 --- Scripts/weather-worldwide.ps1 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Scripts/weather-worldwide.ps1 b/Scripts/weather-worldwide.ps1 index d9c45726..28e96370 100755 --- a/Scripts/weather-worldwide.ps1 +++ b/Scripts/weather-worldwide.ps1 @@ -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])"