Set PowerShell Execution Policy

This object sets the PowerShell execution policy to the desired security level.

Requires PowerShell 5.0

Before using this Automation Manager Object, you must install PowerShell 5.0.

Privileges

Normal

Input Parameters

Name Type Required Description
Execution Policy Scope String Yes Defines the scope on which the execution policy will be set:
  • Current User will set the policy only for the user executing it.
  • Local Machine will set the policy at the computer level.
Execution Policy String Yes Sets the execution policy to the selected value:
  • All Signed. Requires that all scripts and configuration files are signed by a trusted publisher, including scripts written on the local computer.
  • Bypass. Nothing is blocked and there are no warnings or prompts.
  • Remote Signed. Requires that all scripts and configuration files downloaded from the Internet are signed by a trusted publisher. This is the default execution policy for Windows server computers.
  • Restricted. Does not load configuration files or run scripts. This is the default execution policy for Windows client computers.
  • Unrestricted. Beginning in PowerShell 6.0, this is the default execution policy for non-Windows computers and cannot be changed. Loads all configuration files and runs all scripts. If you run an unsigned script that was downloaded from the Internet, you are prompted for permission before it runs.

Output Parameters

Name Type Description
Result Number Returns a success value of zero or any value other than zero to indicate failure.
Result String String Object execution error details.

Example Input Parameters

Name Type Required Example
Execution Policy Scope String Yes Local Machine
Execution Policy String Yes Remote Signed