I noticed that the following:
Get-ChildItem; Write-Host "-----------";
lists the files first and produces the line afterwards. The same happens when I pipe the object like this:
Get-ChildItem | Select-Object; Write-Host "---================---"
However, piping with subset of fields changes the displayed order and the line appears above the files listed.
Get-ChildItem | Select-Object Name; Write-Host "---================---"
How can I explain the phenomenon?