I want to create a script to delete critical error found in both application and system logs in event viewer. I want this to be done every week so I will be using task scheduler to accomplish this. However, I am having trouble creating the script to delete critical errors in event viewer. For starters I am not sure which level option should I include as the Windows documentation for it does not specify how many levels are available, making this very vague.
I tired to run the following script but Powershell deletes everything all events in the application log (information, warning, and error): wevtutil qe Application /q:"*[System[(Level=2)]]" /f:txt | wevtutil cl Application
3