To assist in troubleshooting an issue I needed to clear a specific Windows event log, so my immediate thought was PowerShell! Yes there is a cmdlet Clear-EventLog, however it appears to clear event logs from the very top level (e.g. Application) rather than specific event logs, such as the CodeIntegrity Operational log. It turns out there is another tool that can help – wevtutil.exe, which gives much more control.
To clear the log of your choice first locate it in event viewer, then right click and select Properties. From there take note of the Full Name of the log (in this case Microsoft-Windows-CodeIntegrity/Operational).
With the full name identified, from a command prompt you can run the following command to clear the log.
wevtutil cl Microsoft-Windows-CodeIntegrity/Operational
It’s also possible to view a list of all the logs available by running the following command. Just be aware its a very big list! So you’re probably better identifying the log name through Event Viewer.
wevtutil el