Source PowerShell FTP Server

I want to use FTP to write a mainframe workflow. To do this, I can connect to the mainframe via FTP and run the following commands:

QUOTE TYPE E
QUOTE SITE FILETYPE=JES
PUT myjob.jcl

So how can I do this in PowerShell? I read a lot about standard FTP transfers, but I saw nothing about setting up calls for preparation.

Thanks for reading.

EDIT

Here is the solution I came up with for the answer here and in this article :

@echo off
echo user %1> ftpcmd.dat
echo %2>> ftpcmd.dat
echo QUOTE TYPE E>> ftpcmd.dat
echo QUOTE SITE FILETYPE=JES>> ftpcmd.dat
echo put %3>> ftpcmd.dat
echo quit>> ftpcmd.dat
ftp -n -s:ftpcmd.dat %4
del ftpcmd.dat

Using:

C:\>fileup user123 pa$$word myfile.txt ftp.server.com
+3
source share
2 answers

Can you use the -s switch for FTP and specify a file containing your commands to run?

  -s:filename     Specifies a text file containing FTP commands; the
                  commands will automatically run after FTP starts.

Then you can call it in PowerShell as

ftp -s:<myscript> <host>
+3
source

.NET , /:

FTP PowerShell

System.Net.FtpWebRequest . .

0

All Articles