chore: add Windows agent source baseline

This commit is contained in:
lussierj committed 2026-08-24 20:40:20 +00:00
1 parent c3501b987e
commit 6cd876b4b3
12 files changed
+2574

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
$LogDir = "C:\MinerOpsAgent\logs"
$LogFile = Join-Path $LogDir "pool-poller.log"
if (-not (Test-Path $LogDir)) {
New-Item -ItemType Directory -Path $LogDir -Force | Out-Null
}
$stamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
try {
Add-Content -Path $LogFile -Value "$stamp Starting MinerOps pool poller."
$output = powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\MinerOpsAgent\MinerOpsPoolPoller.ps1" 2>&1
foreach ($line in $output) {
Add-Content -Path $LogFile -Value "$line"
}
$stamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
Add-Content -Path $LogFile -Value "$stamp Pool poller finished."
Add-Content -Path $LogFile -Value ""
}
catch {
$stamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
Add-Content -Path $LogFile -Value "$stamp Pool poller failed: $($_.Exception.Message)"
Add-Content -Path $LogFile -Value ""
exit 1
}