Understanding the $LASTEXITCODE and exit codes in PowerShell
When working with Azure DevOps pipelines you will often want your tasks to run PowerShell scripts. Since the execution of the upcoming tasks can be dependent to the result of the current task, your script will have to inform about success or error.
For this task you can use exit codes, which indicate the success or failure of a command or script. We are also going to learn how to use the $LASTEXITCODE
variable to determine the outcome of your commands.