Delete all entries from a specified event log on a local or remote computer.
Syntax
Clear-EventLog [-LogName] string[] [[-ComputerName] string[]]
[-Confirm] [-WhatIf] [CommonParameters]
Key:
-logName string
Name of the log file from which to clear log events.
-ComputerName string[]
Clear events from a remote computer.
The default is the local computer.
-confirm
Prompt for confirmation before executing the command.
-whatIf
Describe the command without actually executing it.
CommonParameters:
-Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable,
-OutBuffer -OutVariable.
The ComputerName may be a NetBIOS name, an Internet Protocol (IP) address, or a fully qualified domain name. To specify the local computer, type the computer name, a dot (.), or "localhost". -ComputerName does not rely on Windows PowerShell remoting.
Example
Clear the Application, System and PowerShell event logs:
PS C:\> Clear-eventlog -log application, system, "Windows PowerShell"
“Beware the barrenness of a busy life” ~ Socrates
Related PowerShell Cmdlets:
Get-Eventlog - Get event log data