title: Powershell 2: How to determine what exceptions a cmdlet can throw?
body: <p>Back in my (limited) java programming days, I remember this nice feature where if I tried to make a call that could throw an exception, java would require me to handle that exception or pass it off to something that could.</p>
  
  <p>Anyways, I am writing a piece of powershell code that messes around with objects in Active Directory, so I want to be very, very careful. I've gotten occasional remote timeout errors, and that is leading me toward the more general question:</p>
  
  <p>"How can I know ahead of time which of these cmdlets can throw exceptions indicating dangerous conditions, and what is the list of those possible exceptions?"</p>
  
  <p>I am wondering if the list of exceptions, per cmdlet, is way too long to address all possibilities. I also don't want to just write a generic exception handler, as powershell seems to do OK in the general sense of error handling.</p>
  
  <p>What's the best way to determine, per cmdlet, the list of all exceptions that can occur? Is this even possible / feasible?</p>
  
  <p>Thanks!</p>