I have scheduled two powershell scripts as tasks to run at 00:00.
This morning I checked the event log and found that one of the scripts failed with the following exception:
Failure. The error was: 'Failed to create log entry in: ‘C:\Users\SPSETU~1\AppData\Local\Temp\PowerShellLog.txt’. The error was: ‘The process cannot access the file 'C:\Users\SPsetupAdmin\AppData\Local\Temp\PowerShellLog.txt' because it is being used by another process.’.'.
- Can be the problem related to logs? Both the scripts are using the write-log function (see poshcode.org) and log in the windows event log with the same id.
- Do you know any known conflict among powershell scripts as scheduled tasks?
- Do I have to execute tasks one a time?