I have ArtifactsDirectory folder, that contains subfolders called 5.1.0.1, 5.1.0.2, ... , 5.1.0.N.
Each 5.1.0.X folder contains outputs(dlls, exe files) of another build.
Now I want to create a build definition for Installer that will grab the latest build output (5.1.0.N) and include it to my installation package.
For this purpose I need to identify which of 5.1.0.X folders is the latest.
The best approach will be to find "latest" by folder's creation date, but I'm sure that 5.1.0.i-1 was created before 5.1.0.i, so I will be happy just to define "latest" by its number - I mean ordering by folder name: 5.1.0.1 is the oldest, 5.1.0.N is the latest.
So, how can I get this in MSBuild? Which MSBuild tasks can help me?