CmdID / PowerShell / Cmdlets / Get
Get-Event
Gets the events in the event queue. PowerShell reference
From the PowerShell reference 2 parameters
What it does
Gets the events in the event queue. The Get-Event cmdlet gets events in the PowerShell event queue for the current session. You can get all events or use the EventIdentifier or SourceIdentifier parameter to specify the events. When an event occurs, it is added to the event queue. The event queue includes events for which you have registered, events created by using the New-Event cmdlet, and the event that is raised when PowerShell exits. You can use Get-Event or Wait-Event to get the events. This cmdlet does not get events from the Event Viewer logs. To get those events, use Get-WinEvent or Get-EventLog.
Get-Event [[-SourceIdentifier] <String>] [<CommonParameters>]Get-Event [-EventIdentifier] <Int32> [<CommonParameters>]
Get all events
PS C:> Get-EventIdentifyGet events by source identifier
PS C:> Get-Event -SourceIdentifier "PowerShell.ProcessCreated"IdentifyGet an event based on the time it was generated
PS C:> $Events = Get-Event
PS C:> $Events[0] | Format-List -Property *
ComputerName :
RunspaceId : c2153740-256d-46c0-a57c-b805917d1b7b
EventIdentifier : 1
Sender : System.Management.ManagementEventWatcher
SourceEventArgs : System.Management.EventArrivedEventArgs
SourceArgs : {System.Management.ManagementEventWatcher, System.Management.EventArrivedEventArgs}
SourceIdentifier : ProcessStarted
TimeGenerated : 11/13/2008 12:09:32 PM
MessageData : PS C:> Get-Event | where {$_.TimeGenerated -ge "11/13/2008 12:15:00 PM"}
ComputerName :
RunspaceId : c2153740-256d-46c0-a57c-b8059325d1a0
EventIdentifier : 1
Sender : System.Management.ManagementEventWatcher
SourceEventArgs : System.Management.EventArrivedEventArgs
SourceArgs : {System.Management.ManagementEventWatcher, System.Management.EventArrivedEventArgs}
SourceIdentifier : ProcessStarted
TimeGenerated : 11/13/2008 12:15:00 PM
MessageData :IdentifyGet an event by its identifier
PS C:> Get-Event -EventIdentifier 2IdentifyIts page in the reference: Get-Event.
Parameters
-EventIdentifierSpecifies the event identifiers for which this cmdlet gets events.-SourceIdentifierSpecifies source identifiers for which this cmdlet gets events. The default is all events in the event queue. Wildcards are not permitted.