I would like to change this portion of a PowerShell script which uses WinSCP to connect to an SFTP Server.
I would like to modify this script so that in addition to downloading and then deleting .csv files but with the condition if they have a time stamp which is older than 90 days.
Any assistance is appreciated.
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.FileMask = "*.csv"
$synchronizationResult = $session.SynchronizeDirectories(
[WinSCP.SynchronizationMode]::Local, $localPath, $remotePath, $False, $False,
[WinSCP.SynchronizationCriteria]::Time, $transferOptions)
Add a time constraint to the filemask: