Get-ExecutionPolicy

 

Additional Resources for Get-ExecutionPolicy

 

Listing the Windows PowerShell Script Execution Policy

http://www.microsoft.com/technet/scriptcenter/topics/msh/cmdlets/get-executionpolicy.mspx

 

 

SYNOPSIS

Gets the current execution policy for the shell.

 

SYNTAX

Get-ExecutionPolicy [<CommonParameters>]

 

DETAILED DESCRIPTION

The Get-ExecutionPolicy cmdlet gets the execution policy that is effective in the shell. The execution policy is determined by the user preference that you set by using Set-ExecutionPolicy and the Group Policy settings for the Windows PowerShell execution policy. The default is "Restricted."

 

PARAMETERS

 

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, and -OutVariable. For more information, type, "get-help about_commonparameters".

 

RETURN TYPE

System.String

 

NOTES

 

For more information, type "Get-Help Get-ExecutionPolicy -detailed". For technical information, type "Get-Help Get-ExecutionPolicy -full".

 

For detailed information about Windows PowerShell execution policy, including definitions of the Windows PowerShell policies, type "Get-Help About_Signing".

 

The execution policy is part of the security strategy of Windows PowerShell. It determines whether you can load configuration files (including your Windows PowerShell profile) and run scripts, and determines which scripts, if any, must be digitally signed before they will run.

 

The effective execution policy is determined by the preference that you set by using Set-ExecutionPolicyand the "Turn on Script Execution" group policies for computers and users. The precedence order is Computer Policy >

User Policy > Set-ExecutionPolicy user preference.

 

EXAMPLE 1

 

get-executionpolicy

 

This command gets the current execution policy for the shell.

 

Restricted

 

EXAMPLE 2

 

set-executionpolicy RemoteSigned; get-executionPolicy

 

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

 

RemoteSigned

 

RELATED LINKS

Set-ExecutionPolicy

Get-AuthenticodeSignature

Set-AuthenticodeSignature

about_signing