PowerShell Logo Small

Get-ExecutionPolicy



This is the built-in help made by Microsoft for the command 'Get-ExecutionPolicy', in PowerShell version 2 - as retrieved from Windows version 'Microsoft® Windows Vista™ Ultimate ' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.

SYNOPSIS

Gets the execution policies for the current session.

SYNTAX


Get-ExecutionPolicy [[-Scope] {Process | CurrentUser | LocalMachine | UserPolicy | MachinePolicy}] [-List] [<CommonParameters>]



Search powershellhelp.space

DESCRIPTION


The Get-ExecutionPolicy cmdlet gets the execution policies for the current session.

The execution policy is determined by execution policies that you set by using Set-ExecutionPolicy and the Group Policy settings for the Windows
PowerShell execution policy. The default value is "Restricted."

Without parameters, Get-ExecutionPolicy gets the execution policy that is effective in the session. You can use the List parameter to get all exe
cution policies that affect the session or the Scope parameter to get the execution policy for a particular scope.

For more information, see about_Execution_Policies.



<

RELATED LINKS

Online version: http://go.microsoft.com/fwlink/?LinkID=113315
Set-ExecutionPolicy
Get-AuthenticodeSignature
Set-AuthenticodeSignature
about_Execution_Policies
about_Signing

REMARKS

<

Examples


-------------------------- EXAMPLE 1 --------------------------

C:\PS>get-executionpolicy

Restricted



Description
-----------
This command gets the current execution policy for the shell.








-------------------------- EXAMPLE 2 --------------------------

C:\PS>set-executionpolicy RemoteSigned; get-executionPolicy

RemoteSigned



Description
-----------
These commands set a new user preference for the shell execution policy and then display the effective execution policy. The commands are separat
ed by a semicolon (;). In this example, because there is no Group Policy setting, the user preference is the effective policy for the shell.








-------------------------- EXAMPLE 3 --------------------------

C:\PS>get-executionpolicy -list

Scope ExecutionPolicy
----- ---------------
MachinePolicy Undefined
UserPolicy Undefined
Process Undefined
CurrentUser AllSigned
LocalMachine RemoteSigned

C:\PS> get-executionpolicy
AllSigned



Description
-----------
These commands get all execution policies in the current session and the effective execution policy.

The first command gets all execution policies that affect the current session. The policies are listed in precedence order.

The second command gets only the effective execution policy, which is the one set in the CurrentUser scope.