> For the complete documentation index, see [llms.txt](https://www.udayxd.tech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.udayxd.tech/notes/windows/execution-policy.md).

# Execution Policy

Sometimes we will find that we are unable to run scripts on a system. This is due to a security feature called the `execution policy`, which attempts to prevent the execution of malicious scripts. The possible policies are:

| **Policy**                                                               | **Description**                                                                                                                                                                                                      |
| ------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `AllSigned`                                                              | All                                                                                                                                                                                                                  |
| scripts can run, but a trusted publisher must sign scripts and           |                                                                                                                                                                                                                      |
| configuration files. This includes both remote and local scripts. We     |                                                                                                                                                                                                                      |
| receive a prompt before running scripts signed by publishers that we     |                                                                                                                                                                                                                      |
| have not yet listed as either trusted or untrusted.                      |                                                                                                                                                                                                                      |
| `Bypass`                                                                 | No scripts or configuration files are blocked, and the user receives no warnings or prompts.                                                                                                                         |
| `Default`                                                                | This sets the default execution policy, `Restricted` for Windows desktop machines and `RemoteSigned` for Windows servers.                                                                                            |
| `RemoteSigned`                                                           | Scripts                                                                                                                                                                                                              |
| can run but requires a digital signature on scripts that are downloaded  |                                                                                                                                                                                                                      |
| from the internet. Digital signatures are not required for scripts that  |                                                                                                                                                                                                                      |
| are written locally.                                                     |                                                                                                                                                                                                                      |
| `Restricted`                                                             | This allows individual commands but does not allow scripts to be run. All script file types, including configuration files (`.ps1xml`), module script files (`.psm1`), and PowerShell profiles (`.ps1`) are blocked. |
| `Undefined`                                                              | No                                                                                                                                                                                                                   |
| execution policy is set for the current scope. If the execution policy   |                                                                                                                                                                                                                      |
| for ALL scopes is set to undefined, then the default execution policy of |                                                                                                                                                                                                                      |
| `Restricted` will be used.                                               |                                                                                                                                                                                                                      |
| `Unrestricted`                                                           | This                                                                                                                                                                                                                 |
| is the default execution policy for non-Windows computers, and it        |                                                                                                                                                                                                                      |
| cannot be changed. This policy allows for unsigned scripts to be run but |                                                                                                                                                                                                                      |
| warns the user before running scripts that are not from the local        |                                                                                                                                                                                                                      |
| intranet zone.                                                           |                                                                                                                                                                                                                      |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.udayxd.tech/notes/windows/execution-policy.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
