PowerShell: Clear Windows event logs
My previous post covered clearing Windows event logs. I have now ported the script to PowerShell. While developing a Windows 7 WIM image, I wanted to clear the logs after restoring the image. I already use several PowerShell scripts, so 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
| |