#PowerShell tip of the day: use multiple catch blocks to catch different exception types with a default catch-all block to catch everything else. #ErrorHandling
4
19
123
7K
72
Download Image
@adbertram Who needs error channels? 🤣 Write-Error FTW, not Write-Host !
@adbertram Do you have any tips on easily finding errors types in classes for the catch block? That's always been my issue with multi catches
@adbertram What I found even more interesting about try catch is finally block, because it can be used to catch CTRL + C termination
@adbertram Yeah this is one section of my talk @PSHSummit, spoiler alert :)