< Back

Set-SFTPFile

Sat Jan 18, 2020 7:59 pm

NAME Set-SFTPFile



SYNOPSIS

Copy a local file to a remote host using an existing SFTP Session.





SYNTAX

Set-SFTPFile [-SessionId] <Int32[]> [-LocalFile] <String[]> [-RemotePath] <String> [[-Overwrite]]

[<CommonParameters>]



Set-SFTPFile [-SFTPSession] <SftpSession[]> [-LocalFile] <String[]> [-RemotePath] <String> [[-Overwrite]]

[<CommonParameters>]





DESCRIPTION

Copy a local file to a remote host using an existing SFTP Session.





PARAMETERS

-SessionId <Int32[]>

Session Id of an existing SFTPSession.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-RemotePath <String>

Remote path of directory to which the item will be uploaded. Should not include the filename nor the trailing

slash.



Required? true

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-LocalFile <String[]>

Local path to item to upload



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Overwrite [<SwitchParameter>]

Overrite item on remote host if it already pressent.



Required? false

Position? 3

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-SFTPSession <SftpSession[]>

Existing SFTPSession object.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

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 (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.Int32[]





System.String





SSH.SftpSession[]







OUTPUTS



NOTES









Example 1



PS C:\\> Set-SFTPFile -SessionId 0 -RemotePath "/tmp/dns_validator.py" -LocalFile ./Development/dns_validator.py

-Overwrite



Upload script to target system and overrite it if already present.



RELATED LINKS

Online Version: https://github.com/darkoperator/Posh-SS ... aster/docs