in Powershell 5 we can clear a Windows-Event-Log in this way:
Get-EventLog -LogName * | % { Clear-EventLog -LogName $_.log }
how to do this in Powershell 7??? (using powershell only)
Powershell way of handling windows events is now with Get-WinEvent
but it appears no Clear-WinEvent is available
of course we can do this with wevtutil.exe
or even brute-forcing the logs file deletion after stopping the service...
but i'm asking only with native powershell code.
Get-Command *winevent*
on Posh 7.0.3 returns onlyGet-WinEvent
andNew-WinEvent
. For PowerShell 5.1 it's the same. Seems like they are not supposed to be deleted or someone just forgot half of the features ;) – Burd