I have SharePoint Powershell Script in .ps1 format and it includes 4 commands. When I run this script, it does not stop if any error occurs in middle.
For example, if error occurs at 2nd command it displays error message and starts executing the 3rd command, but I want it to stop at 2nd command and it should not execute any following commands.