I have a script that does runs a couple of Windows processes then copies and/or moves files to a different location. I want to add verification to the script. If the process fails, I want the script to error and notify me. Would that be a function statement?

Thanks