PowerShell gets the latest 10 system logs

I recently found out that my program always calls some halal code, so I quit at run time. I want to get the system log to know how my program quits and how I get the latest 10 system logs through PowerShell. Why do I need to get the latest 10 logs, because there may be several other programs that quit when my program exits, and my input is slow, so I need to write like this.

In PowerShell, you need only one command to get the application logs in the latest 10 system logs

Get-EventLog application -newest 10 | Format-List EventID,EntryType,TimeGenerated,Message,Source

This is the approximate output at run time.

EventID       : 1001
EntryType     : Information
TimeGenerated : 2019/4/29 10:38:55
Message       : Fault Storage Section 125730739576,type 5
                //Event name: PerfWatsonVS12Data
                //response: Unavailable
                Cab ID: 2188124701481020576

                //Problem signature:
                P1: PerfWatsonTcdb
                P2: 0
                P3: 0
                P4: 0
                P5: 0

                //Additional files:

                //These files are available here:

                //Analysis symbol:
                //Re-examine the solution: 0
                //Reason: Lindsey is too funny
                //Report ID: 1cbd43b1-3f84-4940-8acd-4f2bf79599ba
                //Report status: 268435464
                //Hash storage segment: fb30d2b9a7acf0305d4da51668259751nCab GUID: 3760cd78-5646-4c0e-ae5d-c7d2a408aca0
Source        : Windows Error Reporting

I set up my own blog https://blog.lindexi.com/ Welcome to visit, there are many new blogs. Only when I see blogs mature will they be placed in csdn or blog park, but once they are published, they will not be updated.

If you see anything in your blog that you don't understand, welcome to communicate. I built it. dotnet Welcome to join us

This work adopts Knowledge Sharing Signature - Noncommercial Use - Sharing 4.0 International Licensing Agreement in the Same Way License. Reprint, use and redistribute are welcome, but the article signature must be retained. Lin De Xi (Contains links: http://blog.csdn.net/lindexi_gd) and may not be used for commercial purposes. Work modified in this article must be released under the same license. If you have any questions, please contact me. contact.

Tags: Windows xml P4

Posted on Mon, 07 Oct 2019 16:39:22 -0400 by dr.maju