Sort-Object is a great and versatile cmdlet to sort anything you want. Simply specify the property or properties you want to use for sorting:
A little known fact is that Sort-Object also accepts script blocks to sort different criteria. For example, the next line sorts your directory listing by length of name:
Within the curly brackets, $_ represents the objects returned by Dir. As such, Sort-Object uses the result of your script block for sorting.