Bird
0
0

What will be the output of this PowerShell command?

medium📝 Command Output Q4 of 15
PowerShell - System Administration
What will be the output of this PowerShell command?
Get-ScheduledTask -TaskName 'DataSync' | Select-Object -ExpandProperty LastRunTime
AThe date and time when the task last ran
BThe current status of the task
CThe list of triggers associated with the task
DAn error indicating the task does not exist
Step-by-Step Solution
Solution:
  1. Step 1: Understand the cmdlet

    Get-ScheduledTask retrieves the scheduled task object.
  2. Step 2: Property expansion

    Select-Object -ExpandProperty LastRunTime extracts the last run time property value.
  3. Final Answer:

    The date and time when the task last ran -> Option A
  4. Quick Check:

    Check if the property exists and returns a DateTime value [OK]
Quick Trick: LastRunTime shows when task last executed [OK]
Common Mistakes:
  • Confusing State with LastRunTime
  • Expecting a list of triggers instead of a date/time
  • Assuming output is an error without verifying task existence

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes