From Walloping Bongo, 5 Years ago, written in PowerShell.
This paste is a reply to Untitled from Blush Marmoset - view diff
Embed
  1. [xml]$Weather = Get-Content "C:\Users\Morten\Downloads\GetMeasuredWeatherData.xml"
  2.  
  3. $IDLygna = "206"
  4. $IDBekkehallum = ""
  5.  
  6. $Lygna = $Weather.d2LogicalModel.payloadPublication.siteMeasurements | Where-Object { $_.measurementsitereference.id -eq $IDLygna }
  7.  
  8. $LygnaAirTemp = ($lygna.measuredValue | Where-Object {$_.index -eq "101"}).innertext
  9. $LygnaRoadTemp = ($lygna.measuredValue | Where-Object {$_.index -eq "801"}).innertext
  10. $LygnaPrecipitation = ($lygna.measuredValue | Where-Object {$_.index -eq "2501"}).innertext
  11.  
  12. Write-Host -BackgroundColor White -ForegroundColor Red "Status RV4 Lygnasæter"
  13. Write-Host -ForegroundColor Yellow "###################################"
  14. Write-Host -ForegroundColor Green "Nåværende lufttemperatur på Lygna er $lygnaairtemp °C"
  15. Write-Host -ForegroundColor Green "Nåværende veibanetemperatur på Lygna er $lygnaroadtemp °C"
  16. Write-Host -ForegroundColor Green "Nåværende nedbørintensitet på Lygna er $lygnaPrecipitation mm/t"
  17.