Skip to content

Instantly share code, notes, and snippets.

@vMarkusK
Last active July 12, 2016 20:40
Show Gist options
  • Save vMarkusK/09d69d335ba643936503 to your computer and use it in GitHub Desktop.
Save vMarkusK/09d69d335ba643936503 to your computer and use it in GitHub Desktop.
Clears the whole Windows Eventlog
foreach ($log in (get-eventlog -list).Log) {
clear-eventlog -log $log
}
# Alternative way
$logs = get-eventlog -list; $logs.foreach{clear-eventlog -log $_.Log}
@vMarkusK
Copy link
Author

vMarkusK commented Feb 9, 2016

Added "Alternative way"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment