Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Try/Catch and ErrorAction

$
0
0

Hi there,

Following some comments on our scorecard in the Scripting Games I’m not sure I understand how Try/Catch is applied in PowerShell.

I thought any error a cmdlet generates would be caught and pushed into the respective Catch (depending on exception types).

Is this not the case? Do some cmdlets do this by default and others not? If so, how do I tell if I need to add “-ErrorAction Stop”?


Viewing all articles
Browse latest Browse all 13067

Trending Articles