[quote quote=222990]Check this out “PowerShell Clear-WinEvent” at
Hopefully, it is the answer you are looking for….[/quote]
This works. I wrote up a couple of functions based on [System.Diagnostics.Eventing.Reader.EventLogSession] to backup and clear any windows event log.
help Backup-EventLog -ShowWindow
help Clear-SBEventLog -ShowWindow
$EventLogList = @('Application','Security','Microsoft-Windows-RemoteDesktopServices-RdpCoreTS/Operational')
Backup-EventLog -EventLogName $EventLogList -BackupFolder c:\Sandbox\Logs\Test
Clear-SBEventLog -EventLogName $EventLogList -Confirm:$false