Skip to content

New WinSCPTransferOption

Thomas Malkewitz edited this page Oct 2, 2015 · 15 revisions

New-WinSCPTransferOption

Synopsis

Sets options for file transfers.

Syntax

New-WinSCPTransferOption [[-FileMask] <String>] [[-FilePermissions] <FilePermissions>] [-PreserveTimeStamp] [[-State] <TransferResumeSupportState>] [[-Threshold] <Int32>] [[-SpeedLimit] <Int32>] [[-TransferMode] <TransferMode>] [<CommonParameters>]

Description

Sets available options for file transfers between the client and server.

Parameters

-FileMask <String>

http://winscp.net/eng/docs/file_mask

Required? false
Position? 0
Default value  
Accept pipeline input? false
Accept wildcard characters? false

-FilePermissions <FilePermissions>

Permissions to applied to a remote file (used for uploads only).

Required? false
Position? 1
Default value  
Accept pipeline input? false
Accept wildcard characters? false

-PreserveTimeStamp <SwitchParameter>

Preserve timestamp (set last write time of destination file to that of source file). Defaults to true.

Required? false
Position? named
Default value false
Accept pipeline input? false
Accept wildcard characters? false

-State <TransferResumeSupportState>

Sets what files will be transferred with resume support/to temporary filename. Use TransferResumeSupportState.Default for built-in default (currently all files above 100 KB), TransferResumeSupportState.On for all files, TransferResumeSupportState.Off for no file (turn off) or TransferResumeSupportState.Smart for all files above threshold (see Threshold).

Required? false
Position? 2
Default value (New-Object -TypeName WinSCP.TransferResumeSupportState)
Accept pipeline input? false
Accept wildcard characters? false

-Threshold <Int32>

Threshold (in KB) for State.Smart mode.

Required? false
Position? 3
Default value 100
Accept pipeline input? false
Accept wildcard characters? false

-SpeedLimit <Int32>

Limit transfer speed (in KB/s).

Required? false
Position? 4
Default value 0
Accept pipeline input? false
Accept wildcard characters? false

-TransferMode <TransferMode>

Possible values are TransferMode.Binary (default), TransferMode.Ascii and TransferMode.Automatic (based on file extension).

Required? false
Position? 5
Default value (New-Object -TypeName WinSCP.TransferMode)
Accept pipeline input? false
Accept wildcard characters? false

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

Inputs

None

Outputs

WinSCP.TransferOptions

Defines options for file transfers.

Notes

New-WinSCPTransferOption is equivalent to New-Object -TypeName WinSCP.TransferOptions.

Examples

EXAMPLE 1

PS C:\> New-WinSCPTransferOption -PreserveTimeStamp:$false -TransferMode Binary

PreserveTimestamp : False FilePermissions : TransferMode : Binary FileMask : ResumeSupport : default SpeedLimit : 0

EXAMPLE 2

PS C:\> New-WinSCPTransferOption -FilePermissions (New-WinSCPItemPermission -GroupExecute -OtherRead)

PreserveTimestamp : True FilePermissions : -----xr-- TransferMode : Binary FileMask : ResumeSupport : default SpeedLimit : 0

Related links

TransferOption Class
Project Home Page