<?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 Common parameter -ErrorAction not working with Get-NAVol? in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Common-parameter-ErrorAction-not-working-with-Get-NAVol/m-p/77378#M3805</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I noticed that the common parameter -ErrorAction might not work as expected with the cmdlet Get-NaVol. I tried the following to handle errors caused by wrong volume names passed to my script via parameter:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$NAVol = Get-NaVol $Volume -ErrorAction SilentlyContinue -ErrorVariable err&lt;BR /&gt;if ($err) { Write-Host "Error: Volume $Volume not found!" -ForegroundColor red ; exit 1 }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I pass a wrong volume name to my script, an error PowerShell exception message is shown regardless of the value SilentlyContinue which is to suppress these error messages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it a bug or am I doing anything wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tested with Data Ontap PowerShell Toolkit 1.3&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jun 2025 06:59:50 GMT</pubDate>
    <dc:creator>begonetapp</dc:creator>
    <dc:date>2025-06-05T06:59:50Z</dc:date>
    <item>
      <title>Common parameter -ErrorAction not working with Get-NAVol?</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Common-parameter-ErrorAction-not-working-with-Get-NAVol/m-p/77378#M3805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I noticed that the common parameter -ErrorAction might not work as expected with the cmdlet Get-NaVol. I tried the following to handle errors caused by wrong volume names passed to my script via parameter:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$NAVol = Get-NaVol $Volume -ErrorAction SilentlyContinue -ErrorVariable err&lt;BR /&gt;if ($err) { Write-Host "Error: Volume $Volume not found!" -ForegroundColor red ; exit 1 }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I pass a wrong volume name to my script, an error PowerShell exception message is shown regardless of the value SilentlyContinue which is to suppress these error messages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it a bug or am I doing anything wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tested with Data Ontap PowerShell Toolkit 1.3&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2025 06:59:50 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Common-parameter-ErrorAction-not-working-with-Get-NAVol/m-p/77378#M3805</guid>
      <dc:creator>begonetapp</dc:creator>
      <dc:date>2025-06-05T06:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Common parameter -ErrorAction not working with Get-NAVol?</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Common-parameter-ErrorAction-not-working-with-Get-NAVol/m-p/77383#M3806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ErrorAction only applies to non-terminating errors.&amp;nbsp; Most of the getter cmdlets in the Toolkit throw terminating errors if something fails.&amp;nbsp; We may very well reconsider that convention, but you can always do this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: courier new,courier; "&gt;PS C:\&amp;gt; &lt;SPAN style="color: #0000ff;"&gt;try { Get-NaVol asdf } catch { write-host "Try again" }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt;Try again&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Feb 2011 19:57:08 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Common-parameter-ErrorAction-not-working-with-Get-NAVol/m-p/77383#M3806</guid>
      <dc:creator>cknight</dc:creator>
      <dc:date>2011-02-16T19:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: Common parameter -ErrorAction not working with Get-NAVol?</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Common-parameter-ErrorAction-not-working-with-Get-NAVol/m-p/77388#M3807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Understood, but does this comply with PowerShell conventions? A "get-item blabla -ErrorAction SilentlyContinue" supresses the error message and I don't see a big difference between the inention of both cmdlet (get-item and get-navol) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Feb 2011 08:52:49 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Common-parameter-ErrorAction-not-working-with-Get-NAVol/m-p/77388#M3807</guid>
      <dc:creator>begonetapp</dc:creator>
      <dc:date>2011-02-17T08:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Common parameter -ErrorAction not working with Get-NAVol?</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Common-parameter-ErrorAction-not-working-with-Get-NAVol/m-p/77393#M3808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Understood and agreed.&amp;nbsp; This is logged for proper consideration in the next release.&amp;nbsp; Thanks for the feedback!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Feb 2011 14:37:25 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Common-parameter-ErrorAction-not-working-with-Get-NAVol/m-p/77393#M3808</guid>
      <dc:creator>cknight</dc:creator>
      <dc:date>2011-02-17T14:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: Common parameter -ErrorAction not working with Get-NAVol?</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Common-parameter-ErrorAction-not-working-with-Get-NAVol/m-p/77398#M3809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd like to bump the priority of this issue up. The PowerShell APIs are implemented haphazardly like this example, and it makes scripting a real pain.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;$var1 = get-nasnapshot -name 'somevol' -snapname 'doesnotexist'&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This snapshot doesn't exist, but the command doesn't complain. $var1 will be $null. This is good for testing the existence of a snapshot!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;$var2 = get-navol -name 'doesnotexist'&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This volume doesn't exist. The API pukes. Presumably $var2 will be $null, but there is no way to keep the exception from printing on the screen. -ErrorAction would be pretty handy here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Mar 2011 22:19:28 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Common-parameter-ErrorAction-not-working-with-Get-NAVol/m-p/77398#M3809</guid>
      <dc:creator>drdabbles</dc:creator>
      <dc:date>2011-03-08T22:19:28Z</dc:date>
    </item>
  </channel>
</rss>

