Command that output the result in string instead of objects:
ls | Out-String -Stream
Output:
    Directory: C:\MyPath\dir1
Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---          2022-01-22  5:34 PM              0 1.txt
-a---          2022-01-22  5:34 PM              0 2.txt
-a---          2022-01-22  5:34 PM              0 3.txt
I tried to get the same result using a function:
function f {
    [CmdletBinding()]
    param (
        [Parameter(ValueFromPipeline,
            ValueFromPipelineByPropertyName)]
        $Content
    )
    
    process {
        $Content | Out-String -Stream
    }
}
ls | f
However, the output is separated for each item:
    Directory: C:\MyPath\dir1
Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---          2022-01-22  5:34 PM              0 1.txt
    Directory: C:\MyPath\dir1
Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---          2022-01-22  5:34 PM              0 2.txt
    Directory: C:\MyPath\dir1
Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---          2022-01-22  5:34 PM              0 3.txt
How can I use the function to get the same result as the first command?