powershell output to file

C++
ls | Out-File -FilePath c:\PATH\TO\FOLDER\OUTPUT.txtOut-File fileName
Source

Also in C++: