I always seem to open a topic, when I am close to find a solution…
That’s the right approach.
Here the code I put at the begin of the page:
New-UDdynamic -content {
while ($true) {
9..0 | %{
Set-UDElement -id "reload" -Properties @{text="Reload check in $_ seconds"}
start-sleep 1
}
$timestamp=(get-item $page:logs.csvfile).LastWriteTimeUtc.Tostring("yyyy-MM-dd HH:mm.ss")
if ($timestamp -ne $page:logs.timestamp) {
Show-UDToast -Message "Reloading ..."
$page:logs.csv=import-csv $page:logs.csvfile
$page:logs.timestamp=(get-item $page:logs.csvfile).LastWriteTimeUtc.Tostring("yyyy-MM-dd HH:mm.ss")
$page:logs.data=$page:logs.csv | sort-object datim -Descending
Set-UDElement -id timestamp -Properties @{value=$page:logs.timestamp}
Sync-UDElement -id "logstable" #-Wait
}
}
}