I have a directory with the following files:
These files will keep updating every few weeks. For example Program-3.0.79.J1232.exe will automatically be put in this directory in a week or two
Using Power Shell, how would I easily go about getting the path of the latest (NOT WITH last modified) file added. Preferably via alphanumeric sorting
It's fairly simple:
((Gci 'C:\Myfolder' | sort-object name)[-1]).fullname
The [-1
] index means "last item in the array".