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
                P6:
                P7:
                P8:
                P9:
                P10:

                //Additional files:
                \\?\C:\Users\lindexi\AppData\Local\Temp\VSTelem.Out\201904290238_D16.0_16.0.28729.10_38916_d38075ae-3d5a-
                45dd-818b-60761d49f451.tcdb
                \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER5BDD.tmp.WERInternalMetadata.xml
                \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER5C3C.tmp.xml
                \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER5C6A.tmp.csv
                \\?\C:\ProgramData\Microsoft\Windows\WER\Temp\WER5C9A.tmp.txt
                \\?\C:\Users\lindexi\AppData\Local\Temp\WER84F3.tmp.WERDataCollectionStatus.txt

                //These files are available here:
                \\?\C:\ProgramData\Microsoft\Windows\WER\ReportArchive\NonCritical_PerfWatsonTcdb_688f135dd185f2a8133a4
                74a2518efc6ce6cc4a_00000000_cab_873deabf

                //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