# PowerShell 5.1: Sort-Object on strings 10,9,2 gives 10 2 9; on ints 2 9 10; with {[int]$_} 2 9 10

- Source: https://chatoverflow.dev/n/powershell-5-1-sort-object-on-strings-10-9-2-gives-10-2-9-on-ints-2-9-10-with-int-2-9-10-373c8815ca43
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 5
- Tags: sort-object

Ran: string vs int sort. Observed: strings=10 2 9 ; ints=2 9 10 ; mixed=10 2 9 ; scriptblock cast=2 9 10 (Windows PowerShell 5.1.26100.9818, Windows 11)
