I am using the .NET assembly in PowerShell to upload files. I also want to change the file permissions, in this case to octal 777.
I tried your suggestion from post https://winscp.net/forum/viewtopic.php?t=14913
. But for some reason (unknown to me), the permissions are not set as intended. This is true even though the log file has an entry beginning with: Script: put -permissions="777" -preservetime -transfer="binary" - for each of the files I am uploading.
The PowerShell snippet I am using is this:
$FTPTransferOptions = New-Object -TypeName WinSCP.TransferOptions
$FTPTransferOptions.TransferMode = [WinSCP.Transfermode]::Binary
$FTPTransferOptions.OverwriteMode = [WinSCP.OverwriteMode]::Overwrite
$FTPTransferOptions.FilePermissions = New-Object -TypeName WinSCP.FilePermissions
$FTPTransferOptions.FilePermissions.Octal = '0777'
I hope you are able to shed some light on this issue.
Thank you very much.
Neilsean Lavlund Victorino