Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Sort array of full file paths by just filename

$
0
0

Hi
Hope you can all help me

I have an array of files with the full path

$files

c:\foldera\x.txt
c:\foldera\y.txt
c:\folderb\x1.txt
c:\folderb\x2.txt

I would like to sort the array by the filename

c:\foldera\x.txt
c:\folderb\x1.txt
c:\foldera\y.txt
c:\folderb\x2.txt

Can't get the syntax right - can you help me?

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles