I am currently writing a little script/program that will identify and sort certain files in a Windows directory. I am using the ls -n command to output a list of files to later be used by grep for Windows. However, using the following command:
ls -n >test.txt
leaves off the file extensions for file names in the output file. When I use ls -n inside the Powershell console (no output redirection), the file extensions are in the output.
Does anyone know what the issue is or how to do this properly with Powershell?