<?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 How can I process Warning or Error messages from Invoke-NaSsh in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/How-can-I-process-Warning-or-Error-messages-from-Invoke-NaSsh/m-p/39605#M1811</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using the cmdlet Invoke-NaSsh to issue ontap commands that don't have an API call. In this case I want to apply fsecurity configs to a volume. So far I was not able to get the warning or error message that is displayed in the powershell console into a variable. I'd like to check if the command throwed an error. Any help is highly appreciated. I attach the scrit and the console output. Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Import-Module DataONTAP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$napasswd&amp;nbsp;&amp;nbsp;&amp;nbsp; = "p@assw0rd"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Password for the Hosting-Filer, the VFiler and the AD Administrator User&lt;/P&gt;&lt;P&gt;$nahost&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = "g100bpmc002.g100.intern"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Name of the Hosting Filer&lt;/P&gt;&lt;P&gt;$navfiler&amp;nbsp;&amp;nbsp;&amp;nbsp; = "v998spnvv1999gl"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Name of the VFiler (also the NetBIOS Name of the VFiler)&lt;/P&gt;&lt;P&gt;$filename&amp;nbsp;&amp;nbsp;&amp;nbsp; = "aclg999l.conf"&lt;/P&gt;&lt;P&gt;$napath&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = "/vol/" + $navfiler + "/" + $filename&lt;/P&gt;&lt;P&gt;$filedata&amp;nbsp;&amp;nbsp;&amp;nbsp; = "cb56f6f4"&lt;/P&gt;&lt;P&gt;$volname&amp;nbsp;&amp;nbsp;&amp;nbsp; = "g999_filelight_001"&lt;/P&gt;&lt;P&gt;$command&amp;nbsp;&amp;nbsp;&amp;nbsp; = "vfiler run " + $navfiler + " fsecurity apply " + $napath&lt;/P&gt;&lt;P&gt;#$command&amp;nbsp;&amp;nbsp;&amp;nbsp; = "vfiler run " + $navfiler + " cifs shares"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Invoke-NaSsh -Controller $nahost -Command $command -Cred wfauser&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS D:\wfa&amp;gt; .\Test_Invoke-NaSsh.ps1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;===== v998spnvv1999gl&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WARNUNG: fsecurity: /vol/v998spnvv1999gl/aclg999l.conf (Line 2): Unable to parse the security SDDL string.&lt;/P&gt;&lt;P&gt;fsecurity: /vol/v998spnvv1999gl/aclg999l.conf (Line 3): Unable to parse the security SDDL string.&lt;/P&gt;&lt;P&gt;fsecurity: Unable to parse the definition file, quitting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jun 2025 06:24:12 GMT</pubDate>
    <dc:creator>skellner</dc:creator>
    <dc:date>2025-06-05T06:24:12Z</dc:date>
    <item>
      <title>How can I process Warning or Error messages from Invoke-NaSsh</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/How-can-I-process-Warning-or-Error-messages-from-Invoke-NaSsh/m-p/39605#M1811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using the cmdlet Invoke-NaSsh to issue ontap commands that don't have an API call. In this case I want to apply fsecurity configs to a volume. So far I was not able to get the warning or error message that is displayed in the powershell console into a variable. I'd like to check if the command throwed an error. Any help is highly appreciated. I attach the scrit and the console output. Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Import-Module DataONTAP&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$napasswd&amp;nbsp;&amp;nbsp;&amp;nbsp; = "p@assw0rd"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Password for the Hosting-Filer, the VFiler and the AD Administrator User&lt;/P&gt;&lt;P&gt;$nahost&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = "g100bpmc002.g100.intern"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Name of the Hosting Filer&lt;/P&gt;&lt;P&gt;$navfiler&amp;nbsp;&amp;nbsp;&amp;nbsp; = "v998spnvv1999gl"&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Name of the VFiler (also the NetBIOS Name of the VFiler)&lt;/P&gt;&lt;P&gt;$filename&amp;nbsp;&amp;nbsp;&amp;nbsp; = "aclg999l.conf"&lt;/P&gt;&lt;P&gt;$napath&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = "/vol/" + $navfiler + "/" + $filename&lt;/P&gt;&lt;P&gt;$filedata&amp;nbsp;&amp;nbsp;&amp;nbsp; = "cb56f6f4"&lt;/P&gt;&lt;P&gt;$volname&amp;nbsp;&amp;nbsp;&amp;nbsp; = "g999_filelight_001"&lt;/P&gt;&lt;P&gt;$command&amp;nbsp;&amp;nbsp;&amp;nbsp; = "vfiler run " + $navfiler + " fsecurity apply " + $napath&lt;/P&gt;&lt;P&gt;#$command&amp;nbsp;&amp;nbsp;&amp;nbsp; = "vfiler run " + $navfiler + " cifs shares"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Invoke-NaSsh -Controller $nahost -Command $command -Cred wfauser&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS D:\wfa&amp;gt; .\Test_Invoke-NaSsh.ps1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;===== v998spnvv1999gl&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WARNUNG: fsecurity: /vol/v998spnvv1999gl/aclg999l.conf (Line 2): Unable to parse the security SDDL string.&lt;/P&gt;&lt;P&gt;fsecurity: /vol/v998spnvv1999gl/aclg999l.conf (Line 3): Unable to parse the security SDDL string.&lt;/P&gt;&lt;P&gt;fsecurity: Unable to parse the definition file, quitting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2025 06:24:12 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/How-can-I-process-Warning-or-Error-messages-from-Invoke-NaSsh/m-p/39605#M1811</guid>
      <dc:creator>skellner</dc:creator>
      <dc:date>2025-06-05T06:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: How can I process Warning or Error messages from Invoke-NaSsh</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/How-can-I-process-Warning-or-Error-messages-from-Invoke-NaSsh/m-p/39610#M1812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stefan, you can use PowerShell's error handling for that.&amp;nbsp; See 'help about_commonparameters'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, you can capture warnings like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt; color: #0000ff;"&gt;PS C:\&amp;gt; Invoke-NaSsh asdf -WarningVariable warn&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt; color: #0000ff;"&gt;WARNING: asdf not found.&amp;nbsp; Type '?' for a list of commands&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt; color: #0000ff;"&gt;PS C:\&amp;gt; $warn[0] | fl&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt; color: #0000ff;"&gt;Message&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : asdf not found.&amp;nbsp; Type '?' for a list of commands&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt; color: #0000ff;"&gt;InvocationInfo&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : System.Management.Automation.InvocationInfo&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt; color: #0000ff;"&gt;PipelineIterationInfo : {0, 1}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want your script to stop execution if you get a warning, that's easy too:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt; color: #0000ff;"&gt;PS C:\&amp;gt; Invoke-NaSsh asdf -WarningVariable warn -WarningAction stop&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt; color: #0000ff;"&gt;WARNING: asdf not found.&amp;nbsp; Type '?' for a list of commands&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt; color: #ff0000;"&gt;Invoke-NaSsh : Command execution stopped because the preference variable "WarningPreference" or common parameter is set to Stop.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt; color: #ff0000;"&gt;At line:1 char:13&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt; color: #ff0000;"&gt;+ invoke-nassh &amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;nbsp; asdf -WarningVariable warn -WarningAction stop&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt; color: #ff0000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; + CategoryInfo&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : OperationStopped: (:) [Invoke-NaSsh], ParentContainsErrorRecordException&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier; font-size: 8pt; color: #ff0000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; + FullyQualifiedErrorId : ActionPreferenceStop,DataONTAP.PowerShell.SDK.Cmdlets.Toolkit.Ssh.InvokeNaSsh&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2012 15:12:23 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/How-can-I-process-Warning-or-Error-messages-from-Invoke-NaSsh/m-p/39610#M1812</guid>
      <dc:creator>cknight</dc:creator>
      <dc:date>2012-06-29T15:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: How can I process Warning or Error messages from Invoke-NaSsh</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/How-can-I-process-Warning-or-Error-messages-from-Invoke-NaSsh/m-p/39614#M1813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Clinton,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do we have any kind of fsecurity equivalent cmdlet on the roadmap?&amp;nbsp; It would be nice to be able to set permissions on qtrees and folders via a cmdlet in a similar manner to Set-NaCifsShareAcl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Apr 2013 14:01:17 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/How-can-I-process-Warning-or-Error-messages-from-Invoke-NaSsh/m-p/39614#M1813</guid>
      <dc:creator>madden</dc:creator>
      <dc:date>2013-04-24T14:01:17Z</dc:date>
    </item>
  </channel>
</rss>

