Cause of the failure: I'm not absolutely certain here, but from what I've seen its appears that the newer versions of ONTAP with tightened security or when high security is enabled on the ONTAP, Invoke-NcSsh failes to connect. Invoke-NcSsh is a SSH client that uses 3rd party assemblies to establish ssh connections which don't work with this kind of secure ONTAP and hence the error.
I don't know what or when (if at all because of the 3rd party dependency ) DataONTAP PSTK can fix this problem, but your commands can work as before if you deploy the below fix.
The Solution Logic: Some of you might have observed that though Invoke-NcSsh fails, you can still connect to the ONTAP via SSH using other ssh clients like openssh or PuTTy. So now, if I can get my Invoke-NcSsh to use PuTTY to connect to the ONTAP instead of its own failed assemblies, and get the same response object in return, my problem is solved. I've used PuTTY's plink.exe to make it work for me.
Do the following:
1. Install PuTTy from https://www.putty.org/ . Ive tried with version 0.64, 0.69, 0.70 and it works for me. You can take any latest version as you wish.
2. Download the attached file Invoke-NcSsh.txt and copy it to your \WFA\PoSH\Modules folder
3. Open this file in any Editor and Find the line :
$env:Path += '; C:\Program Files (x86)\PuTTY\'
Modify this path according to the installation path of your Putty. The above location should contain plink.exe . If you don't give it correctly you will get error plink.exe not found.
4. Save the file with changing the file extension to .psm1 i.e. the file should now be a powershell module Invoke-NcSsh.psm1
5. That's all, Done.
All your commands will continue working as before. The new definition of Invoke-NcSsh overrides that of the DataONTAP PSTK. It also returns the response object exactly same as done by the old one. Your commands will now work seamlessly.
If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.