mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-02 20:26:56 +02:00
Update list-weather.ps1
This commit is contained in:
parent
90ce306f70
commit
701fe3fa65
@ -71,17 +71,17 @@ try {
|
|||||||
$Hour = $Hourly.time / 100
|
$Hour = $Hourly.time / 100
|
||||||
$Temp = $(($Hourly.tempC.toString()).PadLeft(2))
|
$Temp = $(($Hourly.tempC.toString()).PadLeft(2))
|
||||||
$Precip = $Hourly.precipMM
|
$Precip = $Hourly.precipMM
|
||||||
$Humidity = $Hourly.humidity
|
$Humidity = $(($Hourly.humidity.toString()).PadLeft(3))
|
||||||
$Pressure = $Hourly.pressure
|
$Pressure = $Hourly.pressure
|
||||||
$WindSpeed = $(($Hourly.windspeedKmph.toString()).PadLeft(2))
|
$WindSpeed = $(($Hourly.windspeedKmph.toString()).PadLeft(2))
|
||||||
$WindDir = GetWindDir $Hourly.winddir16Point
|
$WindDir = GetWindDir $Hourly.winddir16Point
|
||||||
$UV = $Hourly.uvIndex
|
$UV = $Hourly.uvIndex
|
||||||
$Clouds = $Hourly.cloudcover
|
$Clouds = $(($Hourly.cloudcover.toString()).PadLeft(3))
|
||||||
$Visib = $(($Hourly.visibility.toString()).PadLeft(2))
|
$Visib = $(($Hourly.visibility.toString()).PadLeft(2))
|
||||||
$Desc = GetDescription $Hourly.weatherDesc.value
|
$Desc = GetDescription $Hourly.weatherDesc.value
|
||||||
if ($Hour -eq 0) {
|
if ($Hour -eq 0) {
|
||||||
if ($Day -eq 0) {
|
if ($Day -eq 0) {
|
||||||
Write-Host -foregroundColor green "TODAY 🌡°C ☂️mm 💧 💨km/h ☀️UV ☁️ 👁km at $Area ($Region, $Country)"
|
Write-Host -foregroundColor green "TODAY 🌡°C ☂️mm 💧 💨km/h ☀️UV ☁️ 👁km at $Area ($Region, $Country)"
|
||||||
} elseif ($Day -eq 1) {
|
} elseif ($Day -eq 1) {
|
||||||
Write-Host -foregroundColor green "TOMORROW"
|
Write-Host -foregroundColor green "TOMORROW"
|
||||||
} else {
|
} else {
|
||||||
@ -89,8 +89,7 @@ try {
|
|||||||
}
|
}
|
||||||
$Day++
|
$Day++
|
||||||
}
|
}
|
||||||
"$(($Hour.toString()).PadLeft(2))°° $($Temp)° $($Precip) $(($Humidity.toString()).PadLeft(3))% $(($WindSpeed.toString()).PadLeft(2)) $WindDir $UV $(($Clouds.toString()).PadLeft(3))% $Visib $Desc"
|
"$(($Hour.toString()).PadLeft(2))°° $Temp° $Precip $Humidity% $WindSpeed $WindDir $UV $Clouds% $Visib $Desc"
|
||||||
$Hour++
|
|
||||||
}
|
}
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
|
Loading…
Reference in New Issue
Block a user