Powershell Scripting Tutorial
Introduction Tools required for Powershell First Powershell script Interacting with userSpecial characters in Windows Powershell scriptingArrays String manipulation Conditional statements Looping statements Passing arguments Passing named arguments Exit status of the script Writing functionsexit status in windows powershell scripting
You can use below variables to see if the last command was successful or not.
$?
$lastExitCode
If the last command was successful, $? will return True. Otherwise it returns False. If the last command was successful, $lastExitCode will have 0 value. Otherwise it has a non zero value. To return an exit code from script, you can use below command.
exit <code-value>
Web development and Automation testing
solutions delivered!!