Closed TrickyTic closed 6 years ago
This looks like an issue with the parameter names to me. https://winscp.net/eng/docs/library_sessionoptions. I never updated the parameter name when I changed the type to a [SecureString]
. can you try this and let me know if it works:
$Opt.SecurePrivateKeyPassphrase = $Secret
let me know if that works, ill get a new version published. Thanks.
Yes, that worked. Thanks for the quick repsonse. And the simple solution :)
Issue Description
The PrivateKeyPassphrase parameter for New-WinSCPSessionOption does not unlock key files protected with a passphrase when passed as a SecureString per documentation and declaration.
When passed as a plain string it works as expected.
Example
Expected Output
Successful connection
Actual Output
Wrong passphrase
WinSCP-PowerShell Version
5.13.2.0
Environment
Windows 10 1709, PSVersion 5.1.16299.431