pwsh 6.0 linux sftp wrapper

When running running the following sftp command on RHEL 7, I get an error that I can’t figure out how to avoid. Any suggestions.(I’ve also tried using &, and start-process)

PS /home/brian> sftp fileprocd@dstrlaaa9504.dsglobal.org:/home/user <<< $“put /mnt/c/b/user.txt”
At line:1 char:54

Missing file specification after redirection operator.
At line:1 char:53

The ‘<’ operator is reserved for future use.
At line:1 char:55

Missing file specification after redirection operator.
At line:1 char:54

The ‘<’ operator is reserved for future use.
At line:1 char:55

The ‘<’ operator is reserved for future use.

  • CategoryInfo : ParserError: (:slight_smile: , ParentContainsErrorRecordException
  • FullyQualifiedErrorId : MissingFileSpecification

Is this one of the commands? Wow, this forum can’t display 3 <'s in a row without a space.

sftp fileprocd@dstrlaaa9504.dsglobal.org:/home/user <<< $"put /mnt/c/b/user.txt"

I’m not sure I understand it. There’s no “<” operator in powershell. But you can pipe. Is that some kind of bash here string? That wouldn’t be the same in powershell. How about:

'put /mnt/c/b/user.txt' | sftp fileprocd@dstrlaaa9504.dsglobal.org:/home/user

Yes it is a “here” string. I got the instructions from here.

It appears that piping did work. Thank you for your help!