Error trying to use private key

Advertisement

andyh
Joined:
Posts:
1

Error trying to use private key

I'm getting a error trying to use a ppk file.
Error: The value supplied is not valid, or the property is read-only. Change the value, and then try again.
What am I doing wrong?

Thx.
# Load WinSCP .NET assembly
Add-Type -Path "C:\Program Files (x86)\WinSCP\WinSCPnet.dll"
 
# Read XML configuration file
[xml]$config = Get-Content "c:\demo\pros-config-testing.xml"
 
# Setup session options
$sessionOptions = New-Object WinSCP.SessionOptions -Property @{
    Protocol = [WinSCP.Protocol]::Sftp
    HostName = $config.Configuration.HostName
    UserName = $config.Configuration.UserName
    PortNumber = $config.Configuration.PortNumber
    SshHostKeyFingerprint = $config.Configuration.SshHostKeyFingerprint

Reply with quote

Advertisement

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

Re: Error trying to use private key

I do not think, this has anything to do with any private key (after all, your code does not even show any use of any private key).

I'm pretty sure that your value of SshHostKeyFingerprint is wrong or incompatible with the version of WinSCP you are using. Show us the value, if you need our help.

Reply with quote

Advertisement

You can post new topics in this forum