Newer
Older
SensorReadings / run-loging.ps1
@fabre fabre on 19 Apr 350 bytes 套壳日志
#!/usr/bin/env pwsh
$appPath = Join-Path $PSScriptRoot "bin/Release/net10.0/linux-arm64/publish/SensorReadings"
$logFile = "/var/log/SensorReadings/SensorReadings-$(Get-Date -Format yyyyMMdd).log"

& $appPath *>> $logFile
$exitCode = $LASTEXITCODE
"[$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')] $appPath ExitCode=$exitCode" >> $logFile

exit $exitCode