≡ Menu

Clear windows event log using PowerShell in Windows 7

I am working on testing a specific functionality in Windows 7 today and as part of that I have to clear “Application” event viewer every time I repeat the test. After running the test for few times, I got vexed up to open eventvwr to clear it manually from GUI. I quickly looked out for powershell option to clear event viewer and ended with below command.

Clear-EventLog -LogName Application

Look at the syntax of Clear-EventLog cmdlet to know more about it’s options.

I saved this command as ps1 and kept it on my desktop. Now I am able to clear event viewer by single mouse click..hey hey.. 🙂

Happy Learning..,
Sitaram Pamarthi