$IDBekkehallum = ""
$Lygna = $Weather.d2LogicalModel.payloadPublication.siteMeasurements | Where-Object { $_.measurementsitereference.id -eq
$LygnaAirTemp =
$LygnaRoadTemp =
$LygnaPrecipitation =
\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"}).