I have some powershell code that gets all the files in a directory and sorts them by name. I am confused on how the sort is working and would like some clarification.
The files are listed as :
1_doc.pdf,
2_doc.pdf,
3_doc.pdf
.....
10_doc.pdf,
11_doc.pdf
When powershell does the sort, it puts them as
1_doc.pdf,
10_doc.pdf,
11_doc.pdf
.....
19_doc.pdf,
2_doc.pdf
I can see that it is looking at the first character and then looking at the second character to do the sort but do I have to rename everything to get it to sort as expected?