<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Invoke-NcSsh : Exception has been thrown by the target of an invocation (ISE vs POWERSHELL) in ONTAP Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Discussions/Invoke-NcSsh-Exception-has-been-thrown-by-the-target-of-an-invocation-ISE-vs/m-p/463091#M45150</link>
    <description>&lt;P&gt;Good day all.&amp;nbsp; I need to pick your brains for a second.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Import-Module DataONTAP&lt;/P&gt;&lt;P&gt;$StorageIP = "10.10.1.40"&lt;/P&gt;&lt;P&gt;$user = "Power"&lt;/P&gt;&lt;P&gt;Connect-NcController $StorageIP -Credential $user -ontapi&lt;BR /&gt;Invoke-NcSsh -Command 'set -confirmations off'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When running those in Powershell ISE, it works fine, but when running this in regular Powershell window, i get the "Invoke-NcSsh : Exception has been thrown by the target of an invocation"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have already checked a couple things&lt;/P&gt;&lt;P&gt;Running this from a server 2022, got the latest ontap module 9.17, running against a 9.12 SAN.&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have putty installed. Putty path is in the $env:path&lt;/P&gt;&lt;P&gt;.&amp;nbsp; Both instances of ISE and Powershell are run using regular user (not as admin)... Putty registry keys are present, etc..&amp;nbsp;&lt;/P&gt;&lt;P&gt;When i type get-module, the only difference between both is the ISE module that is present in the ISE window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you ever experienced this?&lt;/P&gt;&lt;P&gt;I have included a screenshot of both screens so you can see the results.&amp;nbsp; Obviously that is not all the script does, but it is stuck there atm.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 Sep 2025 12:42:41 GMT</pubDate>
    <dc:creator>SOBOU</dc:creator>
    <dc:date>2025-09-11T12:42:41Z</dc:date>
    <item>
      <title>Invoke-NcSsh : Exception has been thrown by the target of an invocation (ISE vs POWERSHELL)</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Invoke-NcSsh-Exception-has-been-thrown-by-the-target-of-an-invocation-ISE-vs/m-p/463091#M45150</link>
      <description>&lt;P&gt;Good day all.&amp;nbsp; I need to pick your brains for a second.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Import-Module DataONTAP&lt;/P&gt;&lt;P&gt;$StorageIP = "10.10.1.40"&lt;/P&gt;&lt;P&gt;$user = "Power"&lt;/P&gt;&lt;P&gt;Connect-NcController $StorageIP -Credential $user -ontapi&lt;BR /&gt;Invoke-NcSsh -Command 'set -confirmations off'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When running those in Powershell ISE, it works fine, but when running this in regular Powershell window, i get the "Invoke-NcSsh : Exception has been thrown by the target of an invocation"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have already checked a couple things&lt;/P&gt;&lt;P&gt;Running this from a server 2022, got the latest ontap module 9.17, running against a 9.12 SAN.&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have putty installed. Putty path is in the $env:path&lt;/P&gt;&lt;P&gt;.&amp;nbsp; Both instances of ISE and Powershell are run using regular user (not as admin)... Putty registry keys are present, etc..&amp;nbsp;&lt;/P&gt;&lt;P&gt;When i type get-module, the only difference between both is the ISE module that is present in the ISE window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you ever experienced this?&lt;/P&gt;&lt;P&gt;I have included a screenshot of both screens so you can see the results.&amp;nbsp; Obviously that is not all the script does, but it is stuck there atm.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Sep 2025 12:42:41 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Invoke-NcSsh-Exception-has-been-thrown-by-the-target-of-an-invocation-ISE-vs/m-p/463091#M45150</guid>
      <dc:creator>SOBOU</dc:creator>
      <dc:date>2025-09-11T12:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Invoke-NcSsh : Exception has been thrown by the target of an invocation (ISE vs POWERSHELL)</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Invoke-NcSsh-Exception-has-been-thrown-by-the-target-of-an-invocation-ISE-vs/m-p/463245#M45157</link>
      <description>&lt;P&gt;&lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/124054"&gt;@SOBOU&lt;/a&gt;&amp;nbsp;is your PowerShell running in constrained language mode?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Check by running the following in both PowerShell ISE and you regular PowerShell:&lt;/P&gt;&lt;PRE&gt;$ExecutionContext.SessionState.LanguageMode&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are in "ConstrainedLanguage" in your normal PowerShell this is the reason for the difference.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2025 05:34:08 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Invoke-NcSsh-Exception-has-been-thrown-by-the-target-of-an-invocation-ISE-vs/m-p/463245#M45157</guid>
      <dc:creator>chamfer</dc:creator>
      <dc:date>2025-09-18T05:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: Invoke-NcSsh : Exception has been thrown by the target of an invocation (ISE vs POWERSHELL)?ref_source=cty-other campaign {udf}--1957</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Invoke-NcSsh-Exception-has-been-thrown-by-the-target-of-an-invocation-ISE-vs/m-p/463264#M45158</link>
      <description>That was one thing I hadn't tried but it shows Full on both ISE or Powershell.&lt;BR /&gt;&lt;BR /&gt;Tks for the suggestion</description>
      <pubDate>Thu, 18 Sep 2025 17:08:45 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Invoke-NcSsh-Exception-has-been-thrown-by-the-target-of-an-invocation-ISE-vs/m-p/463264#M45158</guid>
      <dc:creator>SOBOU</dc:creator>
      <dc:date>2025-09-18T17:08:45Z</dc:date>
    </item>
  </channel>
</rss>

