Update list-weather.ps1

This commit is contained in:
Markus Fleschutz 2023-05-04 13:54:05 +02:00
parent 037bc52bdf
commit ed2527dd13

View File

@ -79,7 +79,9 @@ function GetWindDir { param([string]$Text)
}
try {
Write-Progress "⏳ Loading data from http://wttr.in ..."
$Weather = (Invoke-WebRequest -URI http://wttr.in/${Location}?format=j1 -userAgent "curl" -useBasicParsing).Content | ConvertFrom-Json
Write-Progress -completed "."
$Area = $Weather.nearest_area.areaName.value
$Region = $Weather.nearest_area.region.value
$Country = $Weather.nearest_area.country.value