Bird
0
0

Which of the following is the correct syntax to get the last 5 entries from the System event log using Get-EventLog?

easy📝 Syntax Q3 of 15
PowerShell - System Administration
Which of the following is the correct syntax to get the last 5 entries from the System event log using Get-EventLog?
AGet-EventLog -LogName System -Newest 5
BGet-EventLog -LogName System -Last 5
CGet-EventLog -LogName System -Count 5
DGet-EventLog -LogName System -Top 5
Step-by-Step Solution
Solution:
  1. Step 1: Recall correct parameter for recent entries

    -Newest is the correct parameter to specify how many recent entries to retrieve.
  2. Step 2: Verify syntax correctness

    Options with -Last, -Count, or -Top are invalid parameters for Get-EventLog.
  3. Final Answer:

    Get-EventLog -LogName System -Newest 5 -> Option A
  4. Quick Check:

    Correct syntax uses -Newest [OK]
Quick Trick: Use -Newest to specify number of entries [OK]
Common Mistakes:
  • Using -Last or -Count which are invalid
  • Mixing parameter names from other cmdlets
  • Omitting the -LogName parameter

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes