Home > PowerShell, Windows 7 > Clear windows event log using PowerShell in Windows 7

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

No related content found.

Categories: PowerShell, Windows 7 Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>