PowerShell: Clear Windows event logs
While developing a Windows 7 WIM image, I wanted to clear the event logs after restoring it. I already use several PowerShell scripts, so I ported the script from my previous post to PowerShell. Adding this command gave me a clean set of logs.
Requirements
- Open PowerShell with elevated privileges on Windows 7.
- Create a ps1 file using the script below.
Script
| |