Re: remember downloaded files - filemask - RESOLVED
Thanks for sharing your code.
$wildcard = "*.csv"
Write-Host "Looking for new files..."
$files =
$session.EnumerateRemoteFiles(
$remotePath, $wildcard, [WinSCP.EnumerationOptions]::None)
$session.GetFiles($source, $localFilePath, $False, $transferOptions).Check()
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.ResumeSupport.State = [WinSCP.TransferResumeSupportState]::On
$transferOptions.TransferMode = [WinSCP.TransferMode]::Binary
$transferOptions.FileMask = "*.csv; /PATH1/ | */"
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.ResumeSupport.State = [WinSCP.TransferResumeSupportState]::On
$transferOptions.FileMask = "*.csv | */"
powershell.exe -File C:\path\DownloadNewFilesAno.ps1 -sessionUrl "sftp://username:password@fqdn.com/" -localPath "C:\path" -remotePath "/FILES1" -listPath "C:\path\downloaded.txt"