<?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 Re: Invoking Command with no PowerShell cmdlet using WFA in Active IQ Unified Manager Discussions</title>
    <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Invoking-Command-with-no-PowerShell-cmdlet-using-WFA/m-p/10522#M2112</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jeremy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your response. Here is the code I am trying:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;param (&lt;BR /&gt;[parameter(Mandatory=$true, HelpMessage="Controller")]&lt;BR /&gt;[string]$Controller&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;#Connect to controller&lt;BR /&gt;Connect-WFAController -A $Controller&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$naCredentials = Get-NaCredential -Name $Controller&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Invoke-NaSsh -Name $Controller -Command 'cf enable' -Credential $naCredentials&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try to run this using the Test option for my command creation, it locks up with the cursor time watch and does not complete (not even with a failed).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the difference between NaSsh and NcSsh? We are 7-mode, not cluster mode.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Apr 2013 20:55:19 GMT</pubDate>
    <dc:creator>hninetapp</dc:creator>
    <dc:date>2013-04-22T20:55:19Z</dc:date>
    <item>
      <title>Invoking Command with no PowerShell cmdlet using WFA</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Invoking-Command-with-no-PowerShell-cmdlet-using-WFA/m-p/10512#M2109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;We need to invoke the following commands "cf enable/disable" on a controller. From what we are seeing, there is no PowerShell cmdlet that allows this. Does anyone know of a way to invoke commands like this on a controller when the command does not have a PowerShell cmdlet?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt;I do see there is a Invoke-NaSsh, but we are not sure how to pass the "Credential" option to it through the WFA without having to manually type it in and exposing the password.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2025 06:04:39 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Invoking-Command-with-no-PowerShell-cmdlet-using-WFA/m-p/10512#M2109</guid>
      <dc:creator>hninetapp</dc:creator>
      <dc:date>2025-06-05T06:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Invoking Command with no PowerShell cmdlet using WFA</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Invoking-Command-with-no-PowerShell-cmdlet-using-WFA/m-p/10517#M2111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It would be pretty easy.&amp;nbsp; In your command, pass the Cluster name which has a stored username and password in the credential cache.&amp;nbsp; Use the folllowing snippet to pull the credential from the cache and apply to the command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$credentials = Get-NaCredentials -Host &amp;lt;StorageArray&amp;gt;&lt;/P&gt;&lt;P&gt;Invoke-NcSsh -Name &amp;lt;StorageArray&amp;gt; -Command 'cf enable' -Credential $credentials&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jeremy Goodrum, NetApp&lt;/P&gt;&lt;P&gt;The Pirate&lt;/P&gt;&lt;P&gt;Twitter: @virtpirate&lt;/P&gt;&lt;P&gt;Blog: &lt;A href="http://www.virtpirate.com" target="_blank"&gt;www.virtpirate.com&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Apr 2013 19:53:10 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Invoking-Command-with-no-PowerShell-cmdlet-using-WFA/m-p/10517#M2111</guid>
      <dc:creator>goodrum</dc:creator>
      <dc:date>2013-04-22T19:53:10Z</dc:date>
    </item>
    <item>
      <title>Re: Invoking Command with no PowerShell cmdlet using WFA</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Invoking-Command-with-no-PowerShell-cmdlet-using-WFA/m-p/10522#M2112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jeremy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your response. Here is the code I am trying:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;param (&lt;BR /&gt;[parameter(Mandatory=$true, HelpMessage="Controller")]&lt;BR /&gt;[string]$Controller&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;#Connect to controller&lt;BR /&gt;Connect-WFAController -A $Controller&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$naCredentials = Get-NaCredential -Name $Controller&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Invoke-NaSsh -Name $Controller -Command 'cf enable' -Credential $naCredentials&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try to run this using the Test option for my command creation, it locks up with the cursor time watch and does not complete (not even with a failed).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the difference between NaSsh and NcSsh? We are 7-mode, not cluster mode.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Apr 2013 20:55:19 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Invoking-Command-with-no-PowerShell-cmdlet-using-WFA/m-p/10522#M2112</guid>
      <dc:creator>hninetapp</dc:creator>
      <dc:date>2013-04-22T20:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: Invoking Command with no PowerShell cmdlet using WFA</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Invoking-Command-with-no-PowerShell-cmdlet-using-WFA/m-p/10527#M2113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;*smacks his forehead* my eyes flipped and I said Invoke-NcSSH (for clustered Data ONTAP) instead of Invoke-NaSSH (for traditional Data ONTAP).&amp;nbsp; So it looks like the cmdlet does not work with the test feature (honestly, I hadn't tried to use that feature before).&amp;nbsp; I decided to create a quick command to checks the status of cluster failover and log the output.&amp;nbsp; This works just fine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--------------------------------------------&lt;/P&gt;&lt;P&gt; param (&lt;/P&gt;&lt;P&gt;[parameter(Mandatory=$true, HelpMessage="Controller")]&lt;/P&gt;&lt;P&gt;[string]$Controller&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Connect to controller&lt;/P&gt;&lt;P&gt;Connect-WFAController -Array $Controller&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$msg=Invoke-NaSsh -Command 'cf status'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Get-WFALogger -message ("Test-"+$msg)&lt;/P&gt;&lt;P&gt;--------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;18:56:16.780 INFO&amp;nbsp; [Check Cf Status] ### Command 'Check Cf Status' ###&lt;/P&gt;&lt;P&gt;18:56:17.640 INFO&amp;nbsp; [Check Cf Status] Executing command: ./Check_Cf_Status6041434406201535123.ps1 -Controller 10.101.100.30 &lt;/P&gt;&lt;P&gt;18:56:17.687 INFO&amp;nbsp; [Check Cf Status] Get-NaCredentials -Host 10.101.100.30&lt;/P&gt;&lt;P&gt;18:56:17.702 INFO&amp;nbsp; [Check Cf Status] Credentials successfully provided for '10.101.100.30'&lt;/P&gt;&lt;P&gt;18:56:17.718 INFO&amp;nbsp; [Check Cf Status] Connect-NaController (with credentials) -Name 10.101.100.30&lt;/P&gt;&lt;P&gt;18:56:18.796 INFO&amp;nbsp; [Check Cf Status] Connected to controller&lt;/P&gt;&lt;P&gt;18:56:19.421 DEBUG&amp;nbsp; [Check Cf Status] Cluster enabled, p1-3240cl2 is up.&lt;/P&gt;&lt;P&gt;RDMA Interconnect is up (Link 0 up, Link 1 up).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;18:56:19.499 INFO&amp;nbsp; [Check Cf Status] Command completed, took 2719 milliseconds&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Apr 2013 22:59:35 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Invoking-Command-with-no-PowerShell-cmdlet-using-WFA/m-p/10527#M2113</guid>
      <dc:creator>goodrum</dc:creator>
      <dc:date>2013-04-22T22:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: Invoking Command with no PowerShell cmdlet using WFA</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Invoking-Command-with-no-PowerShell-cmdlet-using-WFA/m-p/10535#M2114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There actually are a couple of PowerShell Toolkit cmdlets for cf enable/disable.&amp;nbsp; They are simply Disable-NaCluster and Enable-NaCluster.&amp;nbsp; (And, there's Get-NaCluster for cluster status info.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's also a command that already does this (change cluster failover monitor status) in the Day-0 example workflow, published here: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.netapp.com/docs/DOC-20088" target="_blank"&gt;https://communities.netapp.com/docs/DOC-20088&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Dave Boone - added Get-NaCluster comment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 16:16:03 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Invoking-Command-with-no-PowerShell-cmdlet-using-WFA/m-p/10535#M2114</guid>
      <dc:creator>bdave</dc:creator>
      <dc:date>2013-04-23T16:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Invoking Command with no PowerShell cmdlet using WFA</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Invoking-Command-with-no-PowerShell-cmdlet-using-WFA/m-p/10543#M2115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Regarding the use of Invoke-NaSsh cmdlet from within a WFA command:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once you use Connect-WFAController, you don't need to set credentials.&amp;nbsp; The default credentials are set automatically.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking at your code, you probably want to use a PowerShell variable to capture the output (STDOUT, STDERR) from Invoke-NaSsh.&amp;nbsp; Just a guess, but WFA may not be handling that output well.&amp;nbsp; For example, instead of this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;Invoke-NaSsh -Name $Controller -Command 'cf enable' -Credential $naCredentials&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;$retVal = Invoke-NaSsh -Name $Controller -Command 'cf enable' &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(The better choice would be to use the cmdlet, Enable-NaCluster, but I just wanted to help with using Invoke-NaSsh with WFA in general.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To take this a few steps further, here are some error checking routine ideas for both checking that Invoke-NaSsh executes successfully, and for parsing the output the command returns:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;# connect to controller&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;Connect-WFAController -Array $Array &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;# Check that the fileName is in the right location on the array.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;if ( ! ( Invoke-NaSsh -Command "software list" | Select-String "\s*$fileName\s*" -Quiet ) )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt; $msg = "Can't find the file $fileName in /etc/software on $Array.&amp;nbsp; Please make sure the software is staged properly in /etc/software."&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt; throw $msg&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;# Perform the software operation&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;try&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt; $retVal = Invoke-NaSsh -Command "software update $fileName $options"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;catch&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt; $msg = "Failed to upgrade software on: " + $Array + ". Message: " + $_.Exception.Message;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt; throw $msg&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;if($retVal.StartsWith("WARNING:") -or $retVal.StartsWith("ERROR:") ) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt; throw $("Software update error occurred: `n" + $retVal)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;} &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;else &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt; Get-WFALogger -Info -message $("Software: " + $fileName + " updated successfully on:&amp;nbsp; " + $Array) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Above code is part of the '0day - Software Update' command in the &lt;A _jive_internal="true" href="https://community.netapp.com/docs/DOC-20088" target="_blank"&gt;Day-0 7-mode example workflow&lt;/A&gt;.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Happy coding,&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 17:04:18 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Invoking-Command-with-no-PowerShell-cmdlet-using-WFA/m-p/10543#M2115</guid>
      <dc:creator>bdave</dc:creator>
      <dc:date>2013-04-23T17:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Invoking Command with no PowerShell cmdlet using WFA</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Invoking-Command-with-no-PowerShell-cmdlet-using-WFA/m-p/10547#M2117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You all for your responses! I will defenitley go with the cf enable/disable cmdlets (must have missed them), but I really appreaciate seeing how to use the Invoke-NaSsh if we were to ever run into a command in the future where we needed it!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 19:12:46 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/Invoking-Command-with-no-PowerShell-cmdlet-using-WFA/m-p/10547#M2117</guid>
      <dc:creator>hninetapp</dc:creator>
      <dc:date>2013-04-23T19:12:46Z</dc:date>
    </item>
  </channel>
</rss>

