Hi,
I have a set of folders and I need to store the path of a particular one in a variable $folder.
The set of folders are all children of a parent folder we'll call "parent". There are a bunch of folders with numeric names and one with a non numeric name.
Here is an example of what is in the "parent" folder:
3.0.2.3
3.0.4.5
4.0.1.3
4.0.1.4
4.0.1.6
4.0.2.1
4.0.2.2
LOGS
BUILD
I want a powershell command that will store the path to the latest version folder (in this case "C:\parent\4.0.2.2") in my $folder variable. I think the best approach would be to filter the non numeric folders with a regex (something like "/d./d./d./d")
and then use the pipeline and gci along with a command that would take the item at the bottom of the list.
However I do not have much experience with the Powershell pipeline and was wondering if any talented Powershell users could help me with this problem.
Thanks!