OnCommand Storage Management Software Discussions

PowerShell toolkit - Invoke-NcSSH private key file

Hi everyone,


We have an issue with the Invoke-NcSSH command.

It was working very well for months and suddenly, last friday, the command failed and required to install putty.


After putty installation done, the command request now to add the remote key into Putty's cache :

PS C:\Users\user> Invoke-ncssh -name $user -command $command -PrivateKeyFile "C:\keys\itsoper\wfa.key" -username $user
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's xxx-sha2-nistp256 key fingerprint is:
xxx-sha2-nistp256 256 03:0d:3b:62:ae:6a:.........
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
Store key in cache? (y/n)

We didn't find how to accept / ignore / bypass this output.


Any idea ?


Re: PowerShell toolkit - Invoke-NcSSH private key file


All my apologize if this question sounds stupid but... did you tried to press "y"  followed by enter ?
At this point, the cmdlet simply ask you if they key offered (by the remote host) should be trusted and added into the known_host file (locally).

Bests Regards,

Re: PowerShell toolkit - Invoke-NcSSH private key file



Have you considered using "Invoke-NcSystemApi" (HTTPS) as an alternative to "Invoke-NcSsh"? (SSH)

Here is an example:







If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Re: PowerShell toolkit - Invoke-NcSSH private key file

have you tried adding this to end of your command