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, lack of permissions go genuine software bug - 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 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.
Code: https://github.com/thekamilpro/About-...
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
◼️◼️◼️
🐤 Twitter: / thekamilpro
📜 LinkedIn: www.linkedin.com/in/kamilpro
🌎 Website: https://kamilpro.com
💻 GitHub: https://github.com/thekamilpro