ASKER
ASKER
Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language built on the .NET Framework. PowerShell provides full access to the Component Object Model (COM) and Windows Management Instrumentation (WMI), enabling administrators to perform administrative tasks on both local and remote Windows systems as well as WS-Management and Common Information Model (CIM) enabling management of remote Linux systems and network devices.
TRUSTED BY
Sounds like you want to export into a CSV format though, tell me, can you write out the log file at the end of processing your script, or do you need to write out the log file on the fly?
If you can wait to the end then you could pipe your errors into an Array object and then export that to CSV afterwards.
If you need to write out a tab delimited file on the fly you could try this, I am assuming your error messages are in made up variables:
"$Error" + "`t" + "$Message" + "`t" + "$Process" | Out-File "C:\Some Folder\Some File.txt" -Append
This would write out the errors to the file and it should also tab delimit them. The `t character is a tab according to PowerShell.