I have a PowerShell script that runs exactly the way I want interactively; creating two log files: one is a csv for graphing the output later, and the other is a basic status log, such as:
Opening database connection at 01/27/2015 09:11:47 Site analysis started. Successfully recorded site metrics.
My scheduled task runs the PowerShell successfully, and commits all my entries to a SQL DB, but my csv and txt log are not completed.
I am using Write-Output and Out-File
My logs are set as such:
$LogFilePath = $("L:\Scripts\Metrics\Site_Analysis.csv") $StatusLogFilePath = $("L:\Scripts\Metrics\Site_Analysis_Status.log")
The PowerShell script runs in:
I really don't want to create a batch file that simply outputs everything such as:
batchfile.bat > file.log
since the desired output is very specific, and I don't want verbose output.
but even with the log files set to the same directory, it still did not output.
Edit @ 9:22AM - 1/27/2015:
Please note that all csv and log file output is historical (output is appended).