From Walloping Bongo, 5 Years ago, written in PowerShell.
This paste is a reply to Untitled from Blush Marmoset - go back
Embed
Viewing differences between Untitled and Re: Untitled updated
\r\n[xml]$Weather = Get-Content "C:\Users\Morten\Downloads\GetMeasuredWeatherData.xml"

#$Weather.d2LogicalModel.payloadPublication.siteMeasurements.Item(207).measuredvalue.measuredvalue.basicdata

$IDLygna = "206"
$IDBekkehallum = ""

$Lygna = $Weather.d2LogicalModel.payloadPublication.siteMeasurements | Where-Object { $_.measurementsitereference.id -eq '206' $IDLygna }

$LygnaAirTemp = $lygna.measuredValue[3].($lygna.measuredValue | Where-Object {$_.index -eq "101"}).innertext
$LygnaRoadTemp = $lygna.measuredValue[2].($lygna.measuredValue | Where-Object {$_.index -eq "801"}).innertext
$LygnaPrecipitation = $lygna.measuredValue[1].($lygna.measuredValue | Where-Object {$_.index -eq "2501"}).