Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Powershell winscp filepermissions

As shown above, this is the correct code:
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.TransferMode = [WinSCP.TransferMode]::Binary
$transferOptions.FilePermissions = New-Object WinSCP.FilePermissions
$transferOptions.FilePermissions.Octal = "0775"


Alternatively, like this:
$transferOptions = New-Object WinSCP.TransferOptions -Property @{
    TransferMode = [WinSCP.TransferMode]::Binary
    FilePermissions = New-Object WinSCP.FilePermissions -Property @{ Octal = "0775" }
}


You can have the latter code generated by WinSCP GUI:
https://beta.winscp.net/eng/docs/ui_generateurl#code
rams