$session.GetFileToDirectoryin PowerShell, yet if a file of the same name already exists in the local folder, it is not getting overwritten, *which I want it to*, in this case.
I could delete the local file manually if present, before downloading, but WinSCP has an
OverwriteMode, yet I may have its syntax wrong, because it's not overwriting, even though I am setting it to.
Please check these
$transferOptionsand let me know what if anything I can do to cause files with the same name downloaded via
GetFileToDirectoryto overwrite identically named files in the local directory.
$transferOptions = New-Object WinSCP.TransferOptions $transferOptions.TransferMode = [WinSCP.TransferMode]::Binary $transferOptions.PreserveTimestamp = $true $transferOptions.FilePermissions = $Null # This is default $transferOptions.transferOptions = [WinSCP.OverwriteMode]::Overwrite