$startTime = (Get-Date).AddDays(-8)
$endTime = (Get-Date).AddDays(-7)
$logName = 'System'
$exportPath = 'C:\Users\Public\Downloads\eventsexport.csv'
Get-WinEvent -FilterHashtable @{LogName = $logName; StartTime = $startTime; EndTime = $endTime} | Export-Csv -Path $exportPath -NoTypeInformation -Force