# File Associations

![File associations in the admin console. ](/files/gpejfQ8zNQICKc5XLdPL)

## Define a File Association

File associations are stored within the `fileAssociations.ps1` file within the configuration directory. You can use the `New-PSUFileAssociation` cmdlet to define associations directly.&#x20;

By default, you'll need to include the script to run and the extension to associate with it.&#x20;

```powershell
New-PSUFileAssociation -Script FileAssociation.ps1 -Extension .ps3
```

## Accessing the File Path

By default, you can use the `$File` parameter within your script to access the full path to the file that caused the file association to trigger.

```powershell
param($File)

$Json = Get-Content $File | ConvertFrom-Json 
```


---

# Agent Instructions: 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.powershelluniversal.com/v3/desktop/file-associations.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.
