PowerShell Error Handling - One error at the time please

preview_player
Показать описание


Code fails - whether because of reasons out of our control, or because we didn't consider the situation it might fail. Expired credentials, timeout connections, and lack of permissions are genuine software bugs - each of these are potential problem which might fall our code over. And if we don't handle the error, our script will simply throw and terminate. It's certainly not a desired state.

In this video, I'll show you different ways PowerShell can error, how to debug such errors and how to handle them - so that we are in control.

00:00 Hello World
00:42 Throw - Terminating error
02:45 Write-Error - Non-Terminating error
04:15 Error Action Preference
05:25 Error Handling Try Catch
10:50 Try Finally
12:45 Investigating errors
15:25 Typed exceptions
17:50 Application errors
21:25 Summary

◼️◼️◼️
Рекомендации по теме
Комментарии
Автор

Nice one and something I am starting to appreciate. Good summary at the end.

KefashWhite