You can use Sort-Object to sort simple variable types. Have a look at the following:
Input can come from a different command. If you’d like to get seven random lottery numbers, you should try this:
You'll find that when you feed complex objects into Sort-Object, you should specify the object property you want to sort on (or else Sort-Object will pick one by itself):
Here are some more examples:
Get-ComputerRestorePoint | Sort-Object Description