Skip to content

Comments

Add ability to upload from stream, and name remote file differently#237

Open
pnorms wants to merge 1 commit intodarkoperator:masterfrom
pnorms:master
Open

Add ability to upload from stream, and name remote file differently#237
pnorms wants to merge 1 commit intodarkoperator:masterfrom
pnorms:master

Conversation

@pnorms
Copy link

@pnorms pnorms commented Nov 14, 2018

This update adds the ability to upload a file directly from a stream IE:
$Users = Get-ADUser -Filter * | ConvertTo-Csv
$Stream = [IO.MemoryStream]::new([Text.Encoding]::UTF8.GetBytes($Users))
Set-SFTPFile -SessionId $SFTPSession.SessionID -LocalFileStream $Stream -RemotePath "/upload/" -RemoteFileName "Users.CSV"

As well as allow the remote filename to be different from the local filename, IE:
Set-SFTPFile -SessionId $SFTPSession.SessionID -LocalFile "C:\temp\Users.csv" -RemotePath "/upload/" -RemoteFileName "Users2.csv"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant