I cannot run powershell scripts on my machine, but maybe I could circumvent the problem by using powershell command line.
Here is what I tried:
<job>
<reference object="WinSCP.Session" />
<script language="VBScript">
Dim key, cmd, Shell, executor, seckey
key = "ABCABCABC....."
cmd = "powershell.exe ConvertTo-SecureString "& key
Set shell = CreateObject("WScript.Shell")
Set executor = shell.Exec(cmd)
executor.StdIn.Close
seckey = executor.StdOut.ReadAll
sessionOptions.SecurePassword = seckey
...
but I get an error stating something like "SecurePassword incorrect argument" (sorry I had to translate the message into English). So, I even wonder if "SecurePassword" is supported at all in VBS.
A full VBS solution would be prefered but if I can find a workaround with a working version of the code above, I would be happy too!