In my case, the FTP Site consists of subdirectories of a timestamp and the files I need to download are inside those. So, rather than doing a
$directoryInfo = $session.ListDirectory($remotePath)
which now I understand would be useful if all the files I'm looking for are in a single remote directory, I'm doing a
$session.EnumerateRemoteFiles
where I'm specifying the remote path, a wildcard, and the
EnumerationOptions
of
AllDirectories
so I can be sure to always find the latest file. If there's a cleaner way to do this, I'm all ears. But, in my case, since the remote directory contains a collection of subdirectories, the
ListDirectory
method wasn't returning the collection of files. Hope this helps someone else! Cheers!