From zyrex, 4 Years ago, written in PowerShell.
Embed
  1.  
  2. [xml]$Weather = Get-Content "C:\Users\Morten\Downloads\GetMeasuredWeatherData.xml"
  3.  
  4. $IDLygna = "206"
  5. $IDBekkehallum = "207"
  6.  
  7. $EndResult = @()
  8. $IDs = "206","207"
  9.  
  10. Foreach ($place in $IDs) {
  11.     $Location = $Weather.d2LogicalModel.payloadPublication.siteMeasurements | Where-Object { $_.measurementsitereference.id -eq $place }
  12.  
  13.     $LocationAirTemp = ($Location.measuredValue | Where-Object {$_.index -eq "101"}).innertext + " °C"
  14.     $LocationRoadTemp = ($Location.measuredValue | Where-Object {$_.index -eq "801"}).innertext + " °C"
  15.     $LocationPrecipitation = ($Location.measuredValue | Where-Object {$_.index -eq "2501"}).innertext + " mm/h"
  16.  
  17.     $Place = $place -replace "206","Lygna" -replace "207","Bekkehallum"
  18.     $Resultname = new-object psobject -Property @{
  19.         Lokasjon = $place
  20.         Lufttemperatur = $LocationAirTemp
  21.         Veibanetemperatur = $LocationRoadTemp
  22.         Nedbørintensitet = $LocationPrecipitation
  23.         }
  24.         $EndResult += $ResultName
  25.     }
  26.  
  27.  
  28. $EndResult
  29.  
  30. $EndResult | where {$_.Lokasjon -eq "Lygna"}