diff --git a/run-loging.ps1 b/run-loging.ps1 new file mode 100644 index 0000000..80c84c7 --- /dev/null +++ b/run-loging.ps1 @@ -0,0 +1,9 @@ +#!/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