> For the complete documentation index, see [llms.txt](https://docs.poshtools.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.poshtools.com/powershell-pro-tools-documentation/powershell-protect/getting-started.md).

# Getting Started

{% embed url="<https://www.youtube.com/watch?v=ocYtcaeWiQQ>" %}

PowerShell Protect can be installed from the PowerShell Gallery.&#x20;

```powershell
Install-Module PowerShellProtect
```

To install the AMSI provider that is used to audit and block scripts, you will need to run the following command.&#x20;

{% hint style="info" %}
This command needs to be run as administrator.&#x20;
{% endhint %}

```powershell
Install-PowerShellProtect
$Configuration = New-PSPConfiguration 
Set-PSPConfiguration -Configuration $Configuration -FileSystem -License '<myLicense>'
```

Once installed, the [Default Rules](/powershell-pro-tools-documentation/powershell-protect/rules.md#default-rules) will be enabled. You can also enable additional rules using the PowerShell Protect configuration cmdlets.&#x20;

{% hint style="info" %}
A license is required to configure your own rules. The built-in rules can be used for free without a license.&#x20;
{% endhint %}

For example, this configuration will block and audit any script that contains a command with `webrequest` in the name.&#x20;

```powershell
$Condition = New-PSPCondition -Property "command" -contains -Value "webrequest"
$BlockAction = New-PSPAction -Block
$FileAction = New-PSPAction -File -Format "{applicationName},{rule}" -Path "%temp%\audit.csv" -Name 'File'
$Rule = New-PSPRule -Name "Web Request" -Condition $Condition -Action @($BlockAction, $FileAction)

$Configuration = New-PSPConfiguration -Rule $Rule -Action @($BlockAction, $FileAction)
Set-PSPConfiguration -Configuration $Configuration -FileSystem -License '<myLicense>'
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.poshtools.com/powershell-pro-tools-documentation/powershell-protect/getting-started.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
