Trying to pipe output to a txt file but the pipe fails " empty pipe..."

This seems like a simple task… Running a Get-ChildItem recursively on a folder, and writing filenames and attributes to a text file of contents…

Get-ChildItem -Path "C:\Users\blablablah\Desktop\R22069\*.*" -Recurse | Select @{Name="MB Size";Expression={ "{0:N1}" -f ($_.Length / 1MB) }}, Fullname, LastWriteTime; | Out-File -FilePath C:\Users\blablablah\Desktop\Filelisting.text

Can anyone see my error? I can’t…lol

Coolbobby,
Welcome to the forum. :wave:t4:

You have a unnecessary semicolon in your code (after LastWriteTime). :wink: If you used VSCode it would have notified you about the error. :point_up_2:t4:

Regardless of that … Since you have more than one property you want to output I’d recommend to output the result of your query to a CSV file like this:

Get-ChildItem -Path 'C:\Users\blablablah\Desktop\R22069\*.*' -Recurse | 
    Select-Object Fullname, LastWriteTime, @{Name = 'MB Size'; Expression = { '{0:N1}' -f ($_.Length / 1MB) }} |
        Export-Csv -Path 'C:\Users\blablablah\Desktop\Filelisting.csv' -NoTypeInformation