Last active
November 17, 2023 20:27
-
-
Save taco-shellcode/b124b103392788f6633e9e38a0e93d1b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Export-Events ($events, $outputPath) { | |
$formattedEvents = $events | ForEach-Object { | |
$_ | ForEach-Object { | |
New-Object PSObject -Property ([ordered]@{Action = $_.Action; AttachmentName = $_.AttachmentName; Date = $_.Date; Division = $_.Division; Recipient = $_.Recipient; SamAccountName = $_.SamAccountName; Sender = $_.Sender; Subject = $_.Subject;}) | |
} | |
} | |
$formattedEvents | Export-Csv $outputPath -NoTypeInformation | |
$gui.LogTextBox.Dispatcher.Invoke('Normal', [action]{$gui.LogTextBox.AppendText("$(Get-Date) - Data has been exported to $outputPath`r`n")}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment