Special characters in sftp password (powershell)

Advertisement

Jimiboboyo
Guest

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 uft-8 and this did the same thing
Regards

Jim

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
31,061
Location:
Prague, Czechia

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?

Reply with quote

jimiboboyo
Guest

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 utf8 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 exemple
SshHostKeyFingerprint = ""
}

Reply with quote

Jimiboboyo
Guest

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

Reply with quote

Advertisement

You can post new topics in this forum