Created
October 12, 2012 06:12
-
-
Save sawilde/3877585 to your computer and use it in GitHub Desktop.
Take a list of files and sort them by name regardless of folder structure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sorted = [IO.Directory]::GetFiles($path, "*.*", [System.IO.SearchOption]::AllDirectories) | | |
Select-Object @{Name="FullName"; Expression={$_}}, @{Name="FileName"; Expression={[IO.Path]::GetFileName($_)}} | | |
Sort-Object FileName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment