[SOLVED] Unknown Command on automation with PowerScript
Hi Guys,
I have created a PowerShell Script which automatically downloads files from a FTP Server.
The connection has to be a SFTP Connection with a Private Key.
That's why I am using WinSCP - thanks for this great piece of software!
Now I'm getting the following error and I have no idea to rid it of..
My code looks like this (just a small part..):
As you can see I'm adding some text with vaiables to the Array $Script.
Because the $SFTPFingerprint contains spaces I am defining the variable as following:
When I am writing the array to a text file I receive the following result:
Now I receive this error message: Unknown command '1024'.
Afer searching the forums I found a Link to this ticket: https://winscp.net/tracker/494
Does somebody got an idea?
I have created a PowerShell Script which automatically downloads files from a FTP Server.
The connection has to be a SFTP Connection with a Private Key.
That's why I am using WinSCP - thanks for this great piece of software!
Now I'm getting the following error and I have no idea to rid it of..
My code looks like this (just a small part..):
$Script += "open sftp://$username@$FTPServer -privatekey=$PPKfile -hostkey=$SFTPFingerprint"
As you can see I'm adding some text with vaiables to the Array $Script.
Because the $SFTPFingerprint contains spaces I am defining the variable as following:
$SFTPFingerprint = '"ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"'
When I am writing the array to a text file I receive the following result:
option batch abort option confirm off open sftp://user@server -privatekey=C:\Scripts\FTPTransfer\keyfile.ppk -hostkey="ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" cd /folger/subfolder option transfer binary get -delete * C:\Scripts\Temp\ close exit
Now I receive this error message: Unknown command '1024'.
Afer searching the forums I found a Link to this ticket: https://winscp.net/tracker/494
Does somebody got an idea?
Last edited by danis on 2012-02-23 11:27; edited 1 time in total