Look at Get-EventLog and Get-WinEvent, as well as ConvertTo-HTML and Out-File. Make sure you’ve run Update-Help in your shell, so that you have the documentation for this, and use Get-Help to read their help and look at the provided examples. The three of them will do what you need.