PowerShell Genie

Why does ErrorAction Stop matter in try/catch?

Question 2 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn

Learn why catch can miss a PowerShell error, how ErrorAction Stop changes cmdlet behavior, and where finally belongs.

Interview · Question 10 of 34

Answer before reveal

Your draft

Write the answer you would give in an interview. The model answer stays hidden until you have drafted at least a short response.

Primary documentation

Get-Item reference

Continue
Genie guideWhy does ErrorAction Stop matter in try/catch?

Learn why catch can miss a PowerShell error, how ErrorAction Stop changes cmdlet behavior, and where finally belongs.