# PS_GetExecutionPolicy

> Returns PowerShellScript execution Policy for the local computer.

Source: https://docs.capaone.com/capainstaller/vb-scripting-library/powershell-functions/ps-getexecutionpolicy/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

### Description

Returns PowerShellScript execution Policy for the local computer  
  
The execution policy can be one of the following values:

- Restricted: No scripts can be run, but single commands can be executed. 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 default execution policy is 'Restricted'. Use the function PS_ExecuteCommand to execute the Set-ExecutionPolicy Cmdlet in order to change the policy

### Syntax

PS_GetExecutionPolicy() As Boolean

### Return value

The result will be stored in gsValue

### Example

**VBScript**

```vb
If bStatus Then bStatus = PS_GetExecutionPolicy()
If bStatus Then bStatus = Job_WriteLog("Custom", "gsValue: " & gsValue(index), bStatus, True)
```

[Scripting Guidelines](/capainstaller/vb-scripting-library/scripting-guidelines/)

### Related functions

[Constants](/capainstaller/vb-scripting-library/addendum/constants/) [Package Property](/capainstaller/vb-scripting-library/addendum/package-property/) [Variables](/capainstaller/vb-scripting-library/addendum/variables/)
