The whole point of using ValueFromPipeline (and ValueFromPipelineByPropertyName) is to replace this syntax:
"c:\windows","c:\Program Files" | ForEach-Object {
Get-DirectoryFileSize -Directory $_
}
With this synax:
"c:\windows","c:\Program Files" | Get-DirectoryFileSize
Even when your function/cmdlet only supports operating on a single thing at a time, when you declare ValueFromPipeline/ValueFromPipelineByPropertyName on a property you need to include the process block so that a user can send a collection that PowerShell will unwrap for you and your function will still work.
Without a process block, the "Step 2" version of the function will only operate on the LAST item in the pipeline, which is not expected behavior.
"c:\windows","c:\program files" | Get-DirectoryFileSize
Directory SizeInMB
--------- --------
c:\program files 0