try this:
ls $env:temp| group {$_.lastwritetime.tostring('yyyy-MM-dd')} |
ft name,count,@{
'n' = 'Directory';
'e' = { $_ |select -expa group | select -first 1 -expa psparentpath | Convert-Path }
}
or you can use new pipelinevariable parameter with version 4