Hello Martin, thank you for the reply, big fan of the application. So, if I add some criteria to the file selection like so:
# Retrieve list of files and sort them from largest to smallest
$files =
$session.ListDirectory($remotePath).Files |
Where-Object { -Not $_.IsDirectory } |
Where-Object { $_.Name -Like "File1*" } | #Limiting Criteria
Sort-Object Length -Descending
I might end up with only one file that I want out of many in the directory. But when I generate the filelist:
$fileList = $files[$start..$i] -join ";"
I end up with a blank variable. So when I hit here:
foreach ($file in $files)
{
$remoteFilePath = "$remotePath/$file"
$localFilePath = "$localPath\$file"
Write-Host "Downloading $remoteFilePath to $localFilePath in $no"
$session.GetFiles($session.EscapeFileMask($remoteFilePath), $localFilePath).Check()
}
I end up downloading the whole $remotePath directory.
Thank you for your continued support of this app!