Editing log text file to add date before the log entry RRS feed

  • Question

  • Hi,

    I am trying to edit my Application log file(sitecore application) using power-shell in a way to include timestamp before log every entry, in the below format 


    however i am unable to do so as I am pretty new to Powershell and looking for help with writing a script to do the same . Any help will be really appreciated 

    Thanks in Advance 


    • Moved by Bill_Stewart Tuesday, December 11, 2018 8:47 PM Unanswerable drive-by question
    Wednesday, July 11, 2018 12:16 PM

All replies

  • I'd suggest taking the time to learn PowerShell first as this can be done quite easily. To get the date in that format you can use:

    Get-Date -Format "yyyy-MM-dd hh:mm:ss"
    You should also research the add-content commandlet which can add to an existing document. Let us know how you get on

    Wednesday, July 11, 2018 12:20 PM
  • You cannot edit an event log with script.


    Wednesday, July 11, 2018 12:27 PM