< Back

Set-SFTPFolder

Sat Jan 18, 2020 8:00 pm

NAME Set-SFTPFolder



SYNOPSIS

Uploads a folder to a given location using SFTP.





SYNTAX

Set-SFTPFolder [-SFTPSession] <SftpSession[]> [-LocalFolder] <String[]> [-RemotePath] <String> [[-Overwrite]]

[<CommonParameters>]



Set-SFTPFolder [-SessionId] <Int32[]> [-LocalFolder] <String[]> [-RemotePath] <String> [[-Overwrite]]

[<CommonParameters>]





DESCRIPTION

Uploads a folder to a given location using SFTP.





PARAMETERS

-LocalFolder <String[]>

Local path to folder to be uploaded.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Overwrite [<SwitchParameter>]

Overrite folder on target if it already exists.



Required? false

Position? 3

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-RemotePath <String>

Remote path where to upload the item to, including name.



Required? true

Position? 2

Default value None

Accept pipeline input? True (ByPropertyName)

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



-SessionId <Int32[]>

Session Id of an existing SFTPSession.



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[]

SSH.SftpSession[] System.String System.String[]





OUTPUTS

System.Object







NOTES









Example 1



PS C:\\> Set-SFTPFolder -SessionId 0 -RemotePath "/tmp/site_test" -LocalFolder ./Development/site_src -Overwrite



Upload local folder to tmp directory with a new name.



RELATED LINKS

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