# Hotkeys

PowerShell Universal Desktop supports global hotkeys that can be used to invoke scripts with key chords.&#x20;

![Hotkeys Page in the Admin Console](https://620394196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1JcgdTkn7CUOMdfsVjOO%2Fuploads%2FW5K9ByZxHmindGREK0bt%2Fimage.png?alt=media\&token=55f64c08-1d15-4711-b0e4-bf7dd8730370)

## Define a Hotkey

To define a hotkey, you will need to edit the `hotkeys.ps1` file in the `.universal` folder or through the Settings \ Configurations page within the Admin Console.&#x20;

Hotkeys are defined using the `New-PSUHotkey` cmdlet. For example, the following will invoke `MyScript.ps1` when `Ctrl+I` is pressed anywhere within Windows.&#x20;

```powershell
New-PSUHotkey -Key I -ModifierKey Ctrl -Script 'MyScript.ps1'
```

## Environments&#x20;

You can define which environment the hotkey runs within by using the `-Environment` parameter.&#x20;

```powershell
New-PSUHotkey -Key I -ModifierKey Ctrl -Script 'MyScript.ps1' -Environment 'pwsh'
```

## Parameters&#x20;

You can define parameters passed to the script by using the dynamic parameters provided by `New-PSUHotKey`.&#x20;

For example, if a script accepts a `-Parameter1` parameter, you can define that on `New-PSUHotKey.`

```powershell
param($Parameter1)
```

Within the hotkey, just use `-Parameter1`.&#x20;

```powershell
New-PSUHotkey -Key I -ModifierKey Ctrl -Script 'MyScript.ps1' -Parameter1 'Test'
```


---

# 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/hotkeys.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.
