Multiple choice technology

In Windows PowerShell scripting which of the below is used to catch exceptions occurred during CmdLet execution?

  1. Catch

  2. Get

  3. Throw

  4. Trap

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In PowerShell, the Trap statement is used to catch and handle terminating errors. It's similar to try/catch in other languages. Catch is used with Try, Throw raises errors, and Get is for retrieval.