I am trying to generate a file list in a text file using the below PowerShell Command and it generates an empty file every time.
Get-ChildItem "D:\transfer\SprintReporting\" -recurse | where {$_.extension -eq ".csv"} | % {Write-Host $_.FullName | Out-File D:\transfer\SprintReporting\file.txt -Append}
This script generates the output below but doesn't store it in the file. I have tried it with and without Append, inside and outside the loop scope, but nothing has worked so far. Any ideas what I might be missing here?