title: Writing to error stream in Powershell using Write-Error
body: <p>Why isn't Powershell's <a href="http://technet.microsoft.com/en-us/library/dd315265.aspx" rel="noreferrer"><code>Write-Error</code></a> cmdlet working for me? My output doesn't look like the examples in the documentation:</p>
  
  <pre><code>PS C:\&gt; Write-Error "This is an error"
  Write-Error "This is an error" : This is an error
      + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
      + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException
  </code></pre>
  
  <p>I had been expecting output similar to <a href="http://technet.microsoft.com/en-us/library/dd347569.aspx" rel="noreferrer"><code>Write-Warning</code></a>:</p>
  
  <pre><code>PS H:\&gt; Write-Warning "This is a warning"
  WARNING: This is a warning
  </code></pre>
  
  <p>From the <code>Write-Error</code> and <a href="http://technet.microsoft.com/en-us/library/dd347731.aspx" rel="noreferrer"><code>about_preference_variables</code></a> documentation I thought I should not see any exceptions?</p>
  
  <pre><code>PS H:\&gt; Get-Help About_Preference_Variables
  
  $ErrorActionPreference
  ----------------------
  
  ...
  
          PS&gt; $erroractionpreference                      
          Continue        # Display the value of the preference.                
  
          PS&gt; write-error "Hello, World"                  
                                  # Generate a non-terminating error.
  
          write-error "Hello, World" : Hello, World       
                                  # The error message is displayed and
                                    execution continues.
  
          PS&gt; write-error "Hello, World" -ErrorAction:SilentlyContinue
                                  # Use the ErrorAction parameter with a 
                                    value of "SilentlyContinue".
          PS&gt;                                             
                                  # The error message is not displayed and
                                    execution continues.
  </code></pre>