Put not deleteing files
# Upload files to target directory listed in Global Vars
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.ResumeSupport.State = [WinSCP.TransferResumeSupportState]::Off
#$transferOptions.TransferMode = [WinSCP.TransferMode]::Binary
$OutTransferResult = $session.PutFiles("$Sourcepath\$file", "$destpath", $True, $transferOptions)
We created a powershell script to sweep a folder and post the contents to a FTP server. The acct that runs the script is a administrator on the file server yet even with the $true switch the file wills not delete after transfer.
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.ResumeSupport.State = [WinSCP.TransferResumeSupportState]::Off
#$transferOptions.TransferMode = [WinSCP.TransferMode]::Binary
$OutTransferResult = $session.PutFiles("$Sourcepath\$file", "$destpath", $True, $transferOptions)
We created a powershell script to sweep a folder and post the contents to a FTP server. The acct that runs the script is a administrator on the file server yet even with the $true switch the file wills not delete after transfer.