Although it seems that my answer is too late, I still give you a similar method that you may have found. You can use the sort-Object command in powershell to achieve this purpose.
λ type a.txt
1
10
2
3
5
8
90
11
After using type a.txt | sort-object -property {$_ -as [int]}:
Although it seems that my answer is too late, I still give you a similar method that you may have found.
You can use the sort-Object command in powershell to achieve this purpose.
After using type a.txt | sort-object -property {$_ -as [int]}: