PowerShell - Cmdlets and PipelineWhich of the following demonstrates the correct way to use a parameter with a PowerShell cmdlet?AGet-Process Name='notepad'BGet-Process -Name 'notepad'CGet-Process /Name notepadDGet-Process --Name notepadCheck Answer
Step-by-Step SolutionSolution:Step 1: Recall parameter syntaxPowerShell cmdlets use a dash (-) before parameter names.Step 2: Identify correct usageParameters are specified as -ParameterName followed by the value.Final Answer:Get-Process -Name 'notepad' -> Option BQuick Check:Parameters start with a dash (-) [OK]Quick Trick: Parameters use dash before name [OK]Common Mistakes:Using equal sign instead of dashUsing slashes like in other shellsDouble dashes which are invalid in PowerShell
Master "Cmdlets and Pipeline" in PowerShell9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More PowerShell Quizzes Cmdlets and Pipeline - Pipeline object flow - Quiz 10hard Cmdlets and Pipeline - Get-Help for documentation - Quiz 6medium Control Flow - If-elseif-else statements - Quiz 10hard Control Flow - For loop - Quiz 5medium Control Flow - Switch with wildcard and regex - Quiz 13medium Control Flow - Switch statement - Quiz 7medium PowerShell Basics and Environment - Command discovery (Get-Command) - Quiz 7medium Variables and Data Types - String type and interpolation - Quiz 8hard Variables and Data Types - Type casting - Quiz 1easy Variables and Data Types - Boolean values - Quiz 4medium