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 Get-EventProps { | |
[cmdletbinding()] | |
Param ( | |
[parameter(ValueFromPipeline)] | |
$event | |
) | |
Process { | |
$eventXml = [xml]$event.ToXML() | |
$eventKeys = $eventXml.Event.EventData.Data | |
$Properties = @{} |
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 Get-PowerShellLog { | |
<# | |
.SYNOPSIS | |
Get-PowerShellLog extracts all PowerShell ScriptBlock Events [Evt 4104] from the Microsoft-Windows-PowerShell/Operational Event log for a specified timeframe | |
.DESCRIPTION | |
Query the event log and pull back all PowerShell ScriptBlock Events. | |
Event 4104 | |
Query and filter | |
.PARAMETER | |
Switch to pull back PowerShell ScriptBlock Log back a desired number of minutes |