Skip to Content

Set-ExecutionPolicy


Description
Changes the user preference for the PowerShell script execution policy.
Syntax
Set-ExecutionPolicy [-ExecutionPolicy] <ExecutionPolicy> [-Scope <ExecutionPolicyScope>] [-Force] [-WhatIf] [-Confirm]
Example
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
Parameters
ExecutionPolicy: Required. Specifies the new execution policy
Scope: Optional. Specifies the scope of the execution policy
Force: Optional. Forces the command to run without asking for confirmation
WhatIf: Optional. Shows what would happen if the command runs
Confirm: Optional. Prompts for confirmation before running the command
Return type
None
Aliases
sep
Supported Windows versions
Windows PowerShell 2.0 and laterWindows 7Windows 8Windows 10Windows 11Windows Server 2008 R2 and later