title: ErrorActionPreference and ErrorAction SilentlyContinue for Get-PSSessionConfiguration
body: <p>My case:</p>
  
  <pre><code>$ErrorActionPreference = "Stop";
  "1 - $ErrorActionPreference;"
  Get-ChildItem NoSuchFile.txt -ErrorAction SilentlyContinue;
  "2 - $ErrorActionPreference;"
  Get-ChildItem NoSuchFile.txt -ErrorAction Stop;
  "3 - $ErrorActionPreference;"
  </code></pre>
  
  <p>Output:</p>
  
  <blockquote>
    <p>1 - Stop;<br>
    2 - Stop;<br>
    and display an error...</p>
  </blockquote>
  
  <p>Now,</p>
  
  <pre><code>$ErrorActionPreference = "Stop";
  "1 - $ErrorActionPreference;"
  (Get-PSSessionConfiguration -Name "MyShellUri" -ErrorAction SilentlyContinue)
  "2 - $ErrorActionPreference;"
  </code></pre>
  
  <p>Output:</p>
  
  <blockquote>
    <p>1 - Stop;<br>
    and display an error... </p>
  </blockquote>
  
  <p>Why doesn't work -ErrorAction SilentlyContinue) for Get-PSSessionConfiguration ?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Now,</p>
  
  <pre><code>$ErrorActionPreference = "Continue"
  "1 - $ErrorActionPreference;"
  (Get-PSSessionConfiguration -Name "MyShellUri" -ErrorAction SilentlyContinue)
  "2 - $ErrorActionPreference;"
  </code></pre>
  
  <p>Output:</p>
  
  <blockquote>
    <p>1 - Continue;<br>
    2 - Continue;</p>
  </blockquote>
  
  <p>Now,</p>
  
  <pre><code>$ErrorActionPreference = "SilentlyContinue"
  "1 - $ErrorActionPreference;"
  (Get-PSSessionConfiguration -Name "MyShellUri" -ErrorAction SilentlyContinue)
  "2 - $ErrorActionPreference;"
  </code></pre>
  
  <p>Output:</p>
  
  <blockquote>
    <p>1 - SilentlyContinue;<br>
    2 - SilentlyContinue;</p>
  </blockquote>
  
  <p>This <a href="https://stackoverflow.com/questions/11198023/why-does-an-error-still-show-when-i-specify-erroraction-silentlycontinue">reference</a>:</p>
  
  <p>The <code>ErrorAction</code> ubiquitous parameter can be used to silence non-terminating errors using the parameter value <code>SilentlyContinue</code> and it can be used to convert non-terminating errors to terminating errors using the parameter value <code>Stop</code>.  However it can't help you ignore terminating errors and in this case Stop-Transcript is throwing a terminating error.  If you want to ignore, use a try/catch e.g.:</p>
  
  <pre><code>try { Stop-Transcript } catch {}
  </code></pre>