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])"