PowerShell - Working with ObjectsWhat will this PowerShell command output?$date = Get-Date$date.DayAThe full date and timeBThe day of the week as a stringCAn error because Day is not a propertyDThe current day number of the monthCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand Get-Date outputGet-Date returns a DateTime object with many properties including Day.Step 2: Identify Day property meaningDay returns the day number of the month (1-31).Final Answer:The current day number of the month -> Option DQuick Check:Day property = C [OK]Quick Trick: DateTime.Day gives day number, not day name [OK]Common Mistakes:Confusing Day with DayOfWeekExpecting full date outputThinking Day is not a property
Master "Working with Objects" in PowerShell9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More PowerShell Quizzes Error Handling - ErrorAction parameter - Quiz 11easy File and Directory Operations - Test-Path for existence checks - Quiz 1easy File and Directory Operations - Writing files (Set-Content, Out-File) - Quiz 1easy File and Directory Operations - Why file management is core to scripting - Quiz 13medium File and Directory Operations - CSV operations (Import-Csv, Export-Csv) - Quiz 6medium Modules and Script Organization - Why modules package reusable code - Quiz 6medium Regular Expressions - match operator - Quiz 12easy Regular Expressions - match operator - Quiz 15hard Regular Expressions - Why regex enables pattern matching - Quiz 15hard Working with Objects - Measure-Object for statistics - Quiz 6medium