PowerShell Behavior Checking idea’s

As mentioned in the header, I say idea’s as there a plenty of creative ways to put in some type of logic to ensure that your script is behaving as it should.

One example of this could be to check if a file is located in a certain directory;

What I have also added is exit codes! Now if this powershell script is used in say something like SCCM, you can pass an exit code of 0 for success

or something else for fail.