title: powershell 2.0 try catch how to access the exception
body: <p>This is the <code>try catch</code> in PowerShell 2.0</p>
  
  <pre class="lang-powershell prettyprint-override"><code>$urls = "http://www.google.com", "http://none.greenjump.nl", "http://www.nu.nl"
  $wc = New-Object System.Net.WebClient 
  
  foreach($url in $urls)
  {
      try
      {
          $url
          $result=$wc.DownloadString($url)
      }
      catch [System.Net.WebException]
      {
          [void]$fails.Add("url webfailed $url")
      }  
  }
  </code></pre>
  
  <p>but what I want to do is something like in c#</p>
  
  <pre class="lang-csharp prettyprint-override"><code>catch( WebException ex)
  {
      Log(ex.ToString());
  }
  </code></pre>
  
  <p>Is this possible?</p>