DBDivaAuto
IS-IT--Management
Hi Everyone,
I am trying to automate a process that I think should be possible in Powershell using the WINSCP as a mediator.
The line in question is
which I also tried
The code runs and returns the following:
PS C:\Windows\system32> C:\Scripts\PutCareBatch.ps1
Connecting to SOMESITE.hhsc.texas.gov:990 ...
TLS connection established. Waiting for welcome message...
Connected
Starting the session...
Session started.
Active session: [1] LOGIN@SOMESITE.hhsc.texas.gov
c:\CareUpload
200 SITE command was accepted
CB230331 | 84 KB | 270.5 KB/s | binary | 100%
Success
The session is starting, the login is accepted, I am passing the site command and the file name and size is there correctly but it is not landing in the Site Filetype = JES area.
Does anyone have code for something similar?
I am trying to automate a process that I think should be possible in Powershell using the WINSCP as a mediator.
The line in question is
Code:
"call `"`"site filetype=JES`"`"" `
Code:
"call site filetype=JES" `
Code:
# PowerShell >=7.3
$PSNativeCommandArgumentPassing = "Legacy"
& "C:\Program Files (x86)\WinSCP\WinSCP.com" `
/log="C:\IPM\FTPLogs\WinSCP.log" /ini=nul `
/Command "open ftps://USERNAME:PW@SOMESITE.hhsc.texas.gov/" `
"lcd c:\CareUpload\" `
[b] "call `"`"site filetype=JES`"`"" `[/b]
"mput -nopreservetime -nopermissions CB%TIMESTAMP#yymmdd%" `
"exit"
$winscpResult = $LastExitCode
if ($winscpResult -eq 0)
{
Write-Host "Success"
}
else
{
Write-Host "Error"
}
The code runs and returns the following:
PS C:\Windows\system32> C:\Scripts\PutCareBatch.ps1
Connecting to SOMESITE.hhsc.texas.gov:990 ...
TLS connection established. Waiting for welcome message...
Connected
Starting the session...
Session started.
Active session: [1] LOGIN@SOMESITE.hhsc.texas.gov
c:\CareUpload
200 SITE command was accepted
CB230331 | 84 KB | 270.5 KB/s | binary | 100%
Success
The session is starting, the login is accepted, I am passing the site command and the file name and size is there correctly but it is not landing in the Site Filetype = JES area.
Does anyone have code for something similar?