# array
C:\\> (1,2,3).count
3
C:\\> (1,2,3 | measure).count
3
# hashtable
C:\\> @{1=1; 2=2; 3=3}.count
3
C:\\> (@{1=1; 2=2; 3=3} | measure).count
1
# a
It seem to have something to do with how Measure-Object works and how objects are passed along the pipeline.
When you say
1,2,3 | measure
you get 3 Int32 objects passed onto the pipeline, measure object then counts each object it sees on the pipeline.
When you "unroll it" using your function, you get a single array object passed onto the pipeline which measure object counts as 1, it makes no attempt to iterate through the objects in the array, as shown here:
PS C:\> (measure -input 1,2,3).count
1
A possible work-around is to "re-roll" the array onto the pipeline using foreach:
PS C:\> (UnrollMe 1,2,3 | %{$_} | measure).count
3