SshPrivateKeyPassphrase and ConvertTo-SecureString

Advertisement

edware
Guest

SshPrivateKeyPassphrase and ConvertTo-SecureString

When using
SshPrivateKeyPassphrase
with a text based passphrase the powershell script works fine.
If i try to use it with:
$sessionOptions.SshPrivateKeyPassphrase = ConvertTo-SecureString

I get an error:
Connection has been unexpectedly closed. Server sent command exit status 0.

Reply with quote

Advertisement

edware
Guest

workarount

Found a workaround:

$sessionOptions.SecurePassword = ConvertTo-SecureString 
$sessionOptions.SshPrivateKeyPassphrase = $sessionOptions.SecurePassword

And this works.

Reply with quote

Guest

Re: workarount

edware wrote:

Found a workaround:

$sessionOptions.SecurePassword = ConvertTo-SecureString 
$sessionOptions.SshPrivateKeyPassphrase = $sessionOptions.SecurePassword

And this works.

Now when testing on another system it is not working.

Reply with quote

Advertisement

You can post new topics in this forum