Bird
0
0

Which of the following is the correct syntax to get the last 10 entries from the System event log in PowerShell?

easy📝 Syntax Q12 of 15
PowerShell - System Administration
Which of the following is the correct syntax to get the last 10 entries from the System event log in PowerShell?
AGet-EventLog -LogName System -Last 10
BGet-EventLog -LogName System -Newest 10
CGet-EventLog -Log System -Last 10
DGet-EventLog -LogName System -Top 10
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct parameter for log name

    The parameter to specify the log is '-LogName', so Get-EventLog -Log System -Last 10 is incorrect because it uses '-Log'.
  2. Step 2: Identify correct parameter for number of entries

    The correct parameter to get recent entries is '-Last', not '-Newest' or '-Top'.
  3. Final Answer:

    Get-EventLog -LogName System -Last 10 -> Option A
  4. Quick Check:

    Use -LogName and -Last for recent entries [OK]
Quick Trick: Use -LogName and -Last to get recent events [OK]
Common Mistakes:
  • Using -Log instead of -LogName
  • Using -Newest or -Top which are invalid parameters
  • Mixing parameter names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes