Sorting Text Files

Share |

Join PowerShell.com!
Subscribe to Feed

PowerShell eBook
Sign up for
Your PowerTip of the Day:

Award-winning PowerShellPlus


Admin Guide to PowerShell Remoting


Mastering PowerShell eBook

You need to sort a text file, maybe a list of servers or names? Here is how:

$file = $home\serverlist.txt
Get-Content $file | Sort-Object | Set-Content $file

Posted Mar 04 2009, 08:00 AM by ps1
Copyright 2012 PowerShell.com. All rights reserved.