Sorting Text Files

Share |

Subscribe to Feed

PowerShell eBook
Sign up for
Your PowerTip of the Day:

Powershell Plus

13 Free SQL Tools from Idera

Free Ebook: Mastering Powershell


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 All rights reserved.