I am very new to writing PS scripts for deploying solutions and activating features. In my current scripts I get errors some time like feature not activated or deactivated properly. I am looking forward to introduce exception handling in my scripts. I want to display some custom messages and move on with rest of the commands.Please point me to some good resources/articles.
|
The answer is, that it depends... If you are running some general provisioning script, you quite often want the script to stop dead in its tracks if an error continues, preferably with an explanation of why the error occurred. In that case either specify If you want to act on a given error, you can set
As Falak mentions, you also have |
|||
|
|
|
You can always use try and catch with PowerShell
|
|||||||||
|