I have a folder containing the following files:
- File_1.txt
- File_2.txt
- AnotherFile.txt
I want to be able to achieve an output of: File_1.txt - File_2.txt
I have tried running:
ls .\file*.txt | %{$_.Name}
which returns what I want except on separate lines, how can I join the files returned by a given character (-
in this example)?
Any help is appreciated.