Some operations will take more time so it is a good idea to return feedback. Write-Progress can do just that. Go ahead and add a Foreach-Object to your pipeline, update the progress information with it, and remember to return the data received by Foreach-Object to the following pipeline command:
Dir $env:windir *.log -recurse -ea SilentlyContinue |
Foreach-Object { Write-Progress "Collecting…" $_$_ } |
Sort-Object Length
Foreach-Object { Write-Progress "Collecting…" $_$_ } |
Sort-Object Length