No, the script can run without the execution policy being set. The execution policy must be set before you take any actions in the script. That's why it must be the first thing you do in your script. the try is needed because you can't modify the execution policy if is already set via GPO by your organization. It will throw an error if you try to modify the execution policy when a GPO is in effect.
↧