PowerShell - Basics and EnvironmentYou want to print the result of adding two numbers, 7 and 4, using a single PowerShell command. Which command should you use?AWrite-Output 7, 4BWrite-Output "7 + 4"CWrite-Output 7 4DWrite-Output (7 + 4)Check Answer
Step-by-Step SolutionSolution:Step 1: Understand how to calculate expressions in Write-OutputUsing parentheses causes PowerShell to evaluate the expression before printing.Step 2: Evaluate each optionWrite-Output (7 + 4) uses Write-Output (7 + 4), which calculates 11 and prints it.Final Answer:Write-Output (7 + 4) -> Option DQuick Check:Parentheses evaluate math before output = A [OK]Quick Trick: Use parentheses to calculate before printing [OK]Common Mistakes:Putting math inside quotes prints text, not resultWriting multiple arguments without parenthesesUsing commas prints array, not sum
Master "Basics and Environment" in PowerShell9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More PowerShell Quizzes Cmdlets and Pipeline - Select-Object for properties - Quiz 8hard Cmdlets and Pipeline - Sort-Object for ordering - Quiz 14medium Cmdlets and Pipeline - ForEach-Object for iteration - Quiz 1easy Control Flow - Break and continue - Quiz 4medium Control Flow - ForEach loop - Quiz 13medium Operators - Comparison operators (-eq, -ne, -gt, -lt) - Quiz 11easy Operators - Comparison operators (-eq, -ne, -gt, -lt) - Quiz 12easy String Operations - Select-String for searching - Quiz 8hard Variables and Data Types - Boolean values - Quiz 10hard Variables and Data Types - Boolean values - Quiz 4medium