Script: Unknown command '2048'.

Advertisement

akksam
Joined:
Posts:
3

Script: Unknown command '2048'.

Hi, Could anyone please help in come out of this challenge? Your earliest advise will be greatly appreciated.

When I trigger the following command from PowerShell code getting "Script: Unknown command '2048'. " but if I execute the same from DOS it works fine.
I am not able to understand why this command is not working in PowerShell.

The execution command coded in powershell is that G:\winscp577\winscp /command "open sftp://name:password@domain.com -hostkey=""ssh-rsa **** **:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**""" "ls" /log="G:\winscp577\winscp.log" /loglevel=0

winscp.log says;

< 2016-05-01 11:23:18.795 Script: Active session: [1] name@domain.com
> 2016-05-01 11:23:18.795 Script: 2048
< 2016-05-01 11:23:18.795 Script: Unknown command '2048'.
. 2016-05-01 11:23:18.795 Script: Failed
. 2016-05-01 11:23:18.795 Script: Exit code: 1
. 2016-05-01 11:23:18.795 Closing connection.
. 2016-05-01 11:23:18.795 Sending special code: 12
. 2016-05-01 11:23:18.795 Sent EOF message

Reply with quote

Advertisement

akksam
Joined:
Posts:
3

Found the root cause of the issue but not sure what would be the fix. Kindly advice

Log when I manually executed the command from DOS this works fine

. 2016-05-10 01:01:23.905 Switch: /command
. 2016-05-10 01:01:23.905 Parameter: open sftp://name:password@domain.com -hostkey="ssh-rsa 2048 **:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**"
. 2016-05-10 01:01:23.905 Switch: /log=G:\winscp577\winscp.log
. 2016-05-10 01:01:23.905 Switch: /loglevel=1


Log when I executed the command from PowerShell this is not working
Powershell code: G:\winscp577\winscp /command "open sftp://name:password@domain.com -hostkey=""ssh-rsa **** **:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**""" /log="G:\winscp577\winscp.log" /loglevel=0

Not sure why the command is separated in to 3 lines and there is no double quotes before ssh-rsa

. 2016-05-10 01:13:33.609 Switch: /command
. 2016-05-10 01:13:33.609 Parameter: open sftp://name:password@domain.com -hostkey=ssh-rsa
. 2016-05-10 01:13:33.609 Parameter: 2048
. 2016-05-10 01:13:33.609 Parameter: **:**:**:**:**:**:**:**:**:**:**:**:**:**:**:**"

. 2016-05-10 01:13:33.609 Switch: /log=G:\winscp577\winscp.log
. 2016-05-10 01:13:33.609 Switch: /loglevel=1

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,517
Location:
Prague, Czechia

akksam wrote:

Found the root cause of the issue but not sure what would be the fix. Kindly advice

Log when I manually executed the command from DOS this works fine
...
That's what I've meant.

But again, I'm not a PowerShell expert. Ask in some PowerShell community, or maybe at stackoverflow.com or superuser.com.

Reply with quote

Advertisement

You can post new topics in this forum