Private/Convert-Hourly.ps1
filter Convert-Hourly([TimeSpan]$TimeZoneOffset = [TimeSpan]::Zero, [string]$TemperatureUnit) { $DateTimeUtc = Get-Date -UnixTimeSeconds $_.dt -AsUTC [PSCustomObject]@{ PSTypeName = 'UncommonSense.Weather.Hourly' DateTimeUtc = $DateTimeUtc DateTime = $DateTimeUtc.Add($TimeZoneOffset) TemperatureUnit = $TemperatureUnit Temperature = $_.temp FeelsLike = $_.feels_like Pressure = $_.pressure Humidity = $_.humidity DewPoint = $_.dew_point CloudinessPercent = $_.clouds UVIndex = $_.uvi Visibility = $_.visibility WindSpeed = $_.wind_speed WindGust = $_.wind_gust WindDirection = $_.wind_deg ProbabilityOfPrecipitation = $_.pop RainVolumeLastHour = $_.rain.'1h' SnowVolumeLastHour = $_.snow.'1h' Weather = $_.weather | Convert-Weather } } |