1

I need to write a PowerShell script that reads some data and writes it to a file on a remote SFTP location. I'd rather not generate a local file first before initiating the SFTP session. Can WinSCP work with a byte array to send to the remote folder?

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
bitshift
  • 6,026
  • 11
  • 44
  • 108

1 Answers1

0

Use Session.PutFile method (available since WinSCP 5.19).


For a similar question (just for a download), see:
Access remote file contents as a stream using WinSCP .NET assembly.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992