79719602

Date: 2025-07-30 07:40:39
Score: 0.5
Natty:
Report link

Your code looks fine to me, I can only speculate for reasons.

Could you try it with the -NoHeader option? This is available only after Powershell version 7.4 so pls make sure you have the version requirement.

if (-Not (Test-Path $CSVFile)) {
    $logEntries | Export-Csv -Path $CSVFile -NoTypeInformation
} else {
    # Append with the -NoHeader option
    $logEntries | Export-Csv -Path $CSVFile -NoTypeInformation -Append -NoHeader
}
Reasons:
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (0.5):
Posted by: Simon