title: Try/catch does not seem to have an effect
body: <p>I am new to powershell, and I am trying to add error handling via try/catch statements, but they don't seem to actually be catching the error. This is powershell v2 CP3.</p>
  
  <pre><code>$objComputer = $objResult.Properties;
  $strComputerName = $objComputer.name
  write-host "Checking machine: " $strComputerName
  
  try
  {
      $colItems = get-wmiobject -class "Win32_PhysicalMemory" -namespace "root\CIMV2" -computername $strComputerName -Credential $credentials
      foreach ($objItem in $colItems) 
      {
          write-host "Bank Label: " $objItem.BankLabel
          write-host "Capacity: " ($objItem.Capacity / 1024 / 1024)
          write-host "Caption: " $objItem.Caption
          write-host "Creation Class Name: " $objItem.CreationClassName      
          write-host
      }
  }
  Catch 
  {
      write-host "Failed to get data from machine (Error:"  $_.Exception.Message ")"
      write-host
  }
  finally 
  { }  
  </code></pre>
  
  <p>When it fails to contact a specific machine, I get this in console, and not my clean catch message:</p>
  
  <blockquote>
    <p><code>Get-WmiObject : The RPC server is<br>
    unavailable. (Exception from HRESULT:<br>
    0x800706BA) At Z:\7.0 Intern<br>
    Programvare\Powershell\Get memory of<br>
    all computers in AD.ps1:25 char:34<br>
    +         $colItems = get-wmiobject &lt;&lt;&lt;&lt;  -class "Win32_PhysicalMemory"<br>
    -namespace "root\CIMV2" -computername $strComputerName -Credential<br>
    $credentials<br>
        + CategoryInfo          : InvalidOperation: (:) [Get-WmiObject],<br>
    COMException<br>
        + FullyQualifiedErrorId :   GetWMICOMException,Microsoft.PowerShell.Commands.GetWmiObjectCommand</code>  </p>
  </blockquote>