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 policyScope: Optional. Specifies the scope of the execution policyForce: Optional. Forces the command to run without asking for confirmationWhatIf: Optional. Shows what would happen if the command runsConfirm: 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