Last active
July 12, 2016 20:40
-
-
Save vMarkusK/09d69d335ba643936503 to your computer and use it in GitHub Desktop.
Clears the whole Windows Eventlog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach ($log in (get-eventlog -list).Log) { | |
clear-eventlog -log $log | |
} | |
# Alternative way | |
$logs = get-eventlog -list; $logs.foreach{clear-eventlog -log $_.Log} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added "Alternative way"