get-winEvent application
get-winEvent system
get-winEvent setup # Note: get-eventLog setup is not possible
get-winEvent security # requires admin privileges
get-winEvent -providerName Microsoft-Windows-Kernel-Power
-ListLog
Without admin privileges:
PS C:\> get-winEvent -listLog *
LogMode MaximumSizeInBytes RecordCount LogName
------- ------------------ ----------- -------
Circular 15728640 12392 Windows PowerShell
Circular 20971520 31792 System
Get-WinEvent : Could not retrieve information about the Security log. Error: Attempted to perform an unauthorized operation..
With admin privileges
PS C:\> get-winEvent -listLog *
LogMode MaximumSizeInBytes RecordCount LogName
------- ------------------ ----------- -------
Circular 15728640 12392 Windows PowerShell
Circular 20971520 31792 System
Circular 20971520 25200 Security
Circular 1052672 0 Palo Alto Networks
Circular 1052672 107 OneApp_IGCC
Circular 1052672 1517 OAlerts
Circular 20971520 0 Key Management Service
Get-WinEvent : Could not retrieve information about the Internet Explorer log. Error: Attempted to perform an unauthorized operation..
PS C:\> get-winEvent -listLog * -errorAction silent
PS C:\> get-winEvent -ProviderName *
Get-WinEvent : Could not retrieve information about the Microsoft-System-Diagnostics-DiagnosticInvoker provider. Error: The resource loader cache doesn't have loaded MUI entry.
get-winEvent will eventually(?) replace get-eventLog
get-eventLog only queries the «traditional» event logs (system, application and security), it cannot query ETL type of logs.
get-eventLog is easier to use than get-winEvent.
get-winEvent setup is possible, get-eventLog setup throws an error.
get-eventLog returns instances of System.Diagnostics.EventLogEntry objects, get-winEvent instances of System.Diagnostics.Eventing.Reader.EventLogRecord.