this is what worked:
[code] try
{
Write-Host $date,("Connecting to FTP site.")
# Connect
$session.Open($sessionOptions)
Write-Host $date,("Connected to FTP site.")
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.TransferMode = [WinSCP.TransferMode]::Binary
$TransferOptions.PreserveTimestamp = $false
# Upload files, collect results
$transferResult = $session.PutFiles($localPath, $remotePath, $false, $transferoptions)[/code]
[code] try
{
Write-Host $date,("Connecting to FTP site.")
# Connect
$session.Open($sessionOptions)
Write-Host $date,("Connected to FTP site.")
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.TransferMode = [WinSCP.TransferMode]::Binary
$TransferOptions.PreserveTimestamp = $false
# Upload files, collect results
$transferResult = $session.PutFiles($localPath, $remotePath, $false, $transferoptions)[/code]