Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

@da_chicken: The generated code should escape both dollar and grave/backtick signs. Doesn't it for you? Can you post a screenshot?
da_chicken

I ran into this issue today. The code generator in WinSCP 6.1.1 generates PowerShell code with double quotes. I happen to have a password with both a grave and a dollar sign in the password, and both of those are special characters with double-quoted string literals.
Jimiboboyo

I have resolved this it is a PowerShell issue not a WinSCP issue.
Just needed to wrap the password in single quotes for it to parse the backtick.
If using double quotes the backtick is omitted.
jimiboboyo

Hi Martin

It is the following character I have pasted this in
`
I think it is identified as a grave accent from a UTF-8 website I established this
`   GRAVE ACCENT (U+0060)   60

I have tried to generate URL for password to then use the UTF-8 code in my PowerShell script and this character generates as %60 but I am unsure of the correct syntax.

Should the following syntax work?
$sessionOptions = New-Object WinSCP.SessionOptions -Property @{
    Protocol = [WinSCP.Protocol]::Sftp
    HostName = ""
    UserName = ""
    Password = "%60%50%30%20"   ##random utf-8 codes as example
    SshHostKeyFingerprint = ""
}
martin

Re: Special characters in sftp password (powershell)

So what exact character is that? Can you paste it here? (or its Unicode code)
For what language did you generate the code?
Jimiboboyo

Special characters in SFTP password (PowerShell)

Hi
Have used the GUI to generate session code for PowerShell connection. The connection works in the GUI.
The password contains special characters.
I have enabled logging and the password being used is omitting the ' (apostrophe)
I have the password wrapped in double quotes
This doesn't seem like a normal apostrophe though it is slanted like maybe a grave accent or other.
How can I find out which character this is and force it to be included?
I tried using the URL tool to generate UTF-8 and this did the same thing
Regards

Jim