By default, PowerShell will allow individual commands but will not execute scripts. To set the execution policy, use the Set-ExecutionPolicy commandlet. The commandlet has four different execution policies available:
-
Restricted - No scripts can be run. Windows PowerShell can be used only in interactive mode.
-
AllSigned - Only scripts signed by a trusted publisher can be run.
-
RemoteSigned - Downloaded scripts must be signed by a trusted publisher before they can be run.
-
Unrestricted - No restrictions; all Windows PowerShell scripts can be run.
The PowerShell prompt or ISE must be launched with local administrative authority for the change to be made. The Get-ExecutionPolicy can be used to verify the existing setting.