Bird
0
0

What will this PowerShell command output?

medium📝 Command Output Q5 of 15
PowerShell - Working with Objects
What will this PowerShell command output?
$date = Get-Date
$date.Day
AThe full date and time
BThe day of the week as a string
CAn error because Day is not a property
DThe current day number of the month
Step-by-Step Solution
Solution:
  1. Step 1: Understand Get-Date output

    Get-Date returns a DateTime object with many properties including Day.
  2. Step 2: Identify Day property meaning

    Day returns the day number of the month (1-31).
  3. Final Answer:

    The current day number of the month -> Option D
  4. Quick Check:

    Day property = C [OK]
Quick Trick: DateTime.Day gives day number, not day name [OK]
Common Mistakes:
  • Confusing Day with DayOfWeek
  • Expecting full date output
  • Thinking Day is not a property

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes