You can make use of some sample tasks that allow you to change the PowerShell execution mode. Navigate to Jobs/Tasks -> Sample Tasks -> Notification Server. In the Notification server, you will see two tasks: Enable PowerShell Signing Policy and Disable PowerShell Signing Policy. Use these tasks in combination with your Run Script PowerShell task in a new Job and you're all set.
You job would look as follows:
- Disable PowerShell Signing Policy
- Run your PowerShell Run Script Task
- Enable PowerShell Signing Policy.
If your users are not adminstrators on their machines, you'll need to ensure that these steps are run using the agent credential or an administrator account. Also, notice that the Disable task runs before the Enable task.
If you are unable to find the signing policy tasks, they are simple command scripts that each contain one line.
Disable PowerShell Signing Policy
powershell Set-Executionpolicy unrestricted
Enable PowerShell Signing Policy
powershell Set-Executionpolicy restricted