(Get-ChildItem -File -Recurse -Path $path).Fullname
returns array of full names
(Get-ChildItem -File -Recurse -Path $path).Name
returns array of files names
but
(Get-ChildItem -File -Recurse -Path $path).Length
returns only one value - the count of elements
Question - how to get result as array of file lengths ?
The one value you get is indeed the length of the resulting array - the Array class has an explicit
Length
property that takes precedence over property enumeration.To get the individual
Length
property values from each item in the array, pipe to eitherSelect-Object
orForEach-Object
, like so: