Bird
0
0

What does the PowerShell cmdlet Measure-Object do when used without any parameters on a list of numbers?

easy📝 Conceptual Q1 of 15
PowerShell - Working with Objects
What does the PowerShell cmdlet Measure-Object do when used without any parameters on a list of numbers?
AIt finds the maximum number in the list
BIt counts the number of objects in the list
CIt calculates the sum of the numbers
DIt calculates the average of the numbers
Step-by-Step Solution
Solution:
  1. Step 1: Understand default behavior of Measure-Object

    By default, Measure-Object counts the number of objects passed to it if no property or statistic is specified.
  2. Step 2: Apply to a list of numbers

    When given a list of numbers without parameters, it returns the count of those numbers.
  3. Final Answer:

    It counts the number of objects in the list -> Option B
  4. Quick Check:

    Default Measure-Object = Count [OK]
Quick Trick: Measure-Object counts by default without parameters [OK]
Common Mistakes:
  • Assuming it sums numbers by default
  • Expecting average without -Average
  • Confusing with Max or Min

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes