Challenge - 5 Problems
Measure-Object Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
Output of Measure-Object with Sum and Average
What is the output of the following PowerShell code snippet?
PowerShell
1..5 | Measure-Object -Sum -Average | Select-Object Sum, AverageAttempts:
2 left
💡 Hint
Sum is the total of numbers 1 to 5, average is the sum divided by count.
✗ Incorrect
The sum of numbers 1 to 5 is 15. The average is 15 divided by 5, which is 3.
❓ data_output
intermediate2:00remaining
Count and Maximum Value from Measure-Object
Given the array 3, 7, 2, 9, 5, what does this command output?
PowerShell
3,7,2,9,5 | Measure-Object -Maximum -Count | Select-Object Maximum, Count
Attempts:
2 left
💡 Hint
Count is the number of items, Maximum is the largest number.
✗ Incorrect
There are 5 numbers, and the largest is 9.
🔧 Debug
advanced2:00remaining
Identify the error in Measure-Object usage
What error does this code produce?
PowerShell
1..3 | Measure-Object -Sum -MedianAttempts:
2 left
💡 Hint
Check if Measure-Object supports combining Sum and Median parameters.
✗ Incorrect
Measure-Object does not allow Sum and Median together because they belong to different parameter sets.
🚀 Application
advanced3:00remaining
Calculate Standard Deviation using Measure-Object
Which option correctly calculates the standard deviation of the numbers 4, 8, 6, 5, 3 using Measure-Object and additional code?
Attempts:
2 left
💡 Hint
Standard deviation uses squared differences from the mean and divides by count minus one for sample SD.
✗ Incorrect
Option D correctly computes sample standard deviation using sum of squared differences divided by n-1.
🧠 Conceptual
expert1:30remaining
Understanding Measure-Object Output Properties
Which property is NOT included in the output of Measure-Object when using the -Average parameter?
Attempts:
2 left
💡 Hint
Think about which statistics are calculated by default with -Average.
✗ Incorrect
Measure-Object with -Average returns Sum, Average, and Count but does not include Maximum unless specified.