PowerShell - Cmdlets and PipelineWhich of the following is the correct syntax to select the 'Name' property only from a list of services?AGet-Service | Select-Object -Property NameBGet-Service | Select-Object Name -PropertyCGet-Service | Select-Object -Name PropertyDGet-Service | Select-Object Property -Name NameCheck Answer
Step-by-Step SolutionSolution:Step 1: Identify correct parameter usageSelect-Object uses '-Property' followed by property names.Step 2: Check each option's syntaxOnly Get-Service | Select-Object -Property Name correctly uses '-Property Name'. Others misuse parameters.Final Answer:Get-Service | Select-Object -Property Name -> Option AQuick Check:Use -Property before property names [OK]Quick Trick: Always put -Property before property names [OK]Common Mistakes:Placing property names before -PropertyUsing invalid parameter namesMixing parameter order incorrectly
Master "Cmdlets and Pipeline" in PowerShell9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More PowerShell Quizzes Control Flow - Switch statement - Quiz 1easy Control Flow - Break and continue - Quiz 3easy Operators - Assignment operators - Quiz 6medium String Operations - Select-String for searching - Quiz 10hard String Operations - Select-String for searching - Quiz 13medium String Operations - Regular expressions with -match - Quiz 3easy Variables and Data Types - String type and interpolation - Quiz 3easy Variables and Data Types - Type casting - Quiz 13medium Variables and Data Types - Hash tables (dictionaries) - Quiz 5medium Variables and Data Types - Integer and floating-point types - Quiz 15hard