We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2ad13d7 commit 04aa53cCopy full SHA for 04aa53c
watchdog.ps1
@@ -55,7 +55,7 @@ function Test-RportState {
55
Write-Message "ERROR: Statefile $($stateFile) not found. Not cheching."
56
return
57
}
58
- $now = ((Get-Date -UFormat %s) - [int](Get-Date -UFormat %Z) * 3600)
+ $now = [DateTimeOffset]::Now.ToUnixTimeSeconds()
59
$lastUpdate = (Get-Content $stateFile | ConvertFrom-Json).last_update_ts
60
$diff = $now - $lastUpdate
61
if ($diff -gt $Threshold) {
0 commit comments