I am going through a
tutorial ("Example 5: Measure the contents of a CSV file") which demonstrates how to calculate average years of service of the employees of a company.
I've created a test Excel file with the first row serving as a header with values EmpNo, Years - just as described in the tutorial.
Then I issued the following command:
import-csv C:\Users\user\Desktop\testexcel.xlsx | Measure-Object -Property years -Minimum -Maximum -Average
Please note that I tried to use both "years" and "Years" as an argument (the tutorial uses "years").
And got error:
Measure-Object : The property "years" cannot be found in the input for any objects.
At line:1 char:53
+ ... xcel.xlsx | Measure-Object -Property years -Minimum -Maximum -Average ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Measure-Object], PSArgumentException
+ FullyQualifiedErrorId : GenericMeasurePropertyNotFound,Microsoft.PowerShell.Commands.MeasureObjectCommand
Is the tutorial outdated or is my CSV format incorrect (see printscreen)

Thank you