> For the complete documentation index, see [llms.txt](https://docs.devolutions.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.devolutions.net/powershell-universal/da/powershell-kommandoer/new-psuaitool.md).

# New-PSUAiTool

New-PSUAiTool registrerer et nyt AI-værktøj, der er baseret på et PowerShell-script, i PowerShell Universal og eksponerer det eventuelt via MCP.

## Synopsis

Opretter en ny definition af et AI-værktøj.

## Syntaks

```powershell
New-PSUAiTool -Name <String> -ScriptFullPath <String> [-Description <String>] [-Authenticated] [-Role <String[]>] [-Mcp] [-DefaultMaxWaitTimeoutSeconds <Int32>] [-Environment <String>] [-Computer <String>] [<ConnectionOptions>] [<CommonParameters>]
```

`<ConnectionOptions>`: `[-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]`.

## Beskrivelse

Opretter et AI-værktøj, der er baseret på et PowerShell-script. AI-agenter kan kalde værktøjet; `-Mcp` gør det også tilgængeligt via Model Context Protocol. Værktøjsnavne skal være entydige (der skelnes ikke mellem store og små bogstaver). `-Environment` og `-Computer` angiver standardmålet for udførelse; en computergruppe kan bruge `'<GroupName> (All)'` eller `'<GroupName> (Any)'`. Den maksimale standardventetid for et værktøjsjob er 30 sekunder.

## Eksempler

```powershell
New-PSUAiTool -Name GetTickets -Description 'Query ticket data' -ScriptFullPath 'C:\ProgramData\UniversalAutomation\Repository\scripts\GetTickets.ps1' -Authenticated -Role HelpDesk,Admin -Mcp
New-PSUAiTool -Name GetTickets -ScriptFullPath 'C:\Repository\GetTickets.ps1' -Environment '7.4' -Computer 'Agents (Any)' -DefaultMaxWaitTimeoutSeconds 60 -Mcp
```

## Parametre

| Parameter                       | Beskrivelse                                                                                                      |
| ------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `-Name`                         | Påkrævet entydigt værktøjsnavn.                                                                                  |
| `-ScriptFullPath`               | Påkrævet fuld sti til det implementerende script.                                                                |
| `-Description`                  | Hvad værktøjet gør.                                                                                              |
| `-Authenticated`                | Kræver godkendelse for at udføre værktøjet.                                                                      |
| `-Role`                         | Roller med tilladelse til at udføre det.                                                                         |
| `-Mcp`                          | Eksponerer værktøjet via MCP.                                                                                    |
| `-DefaultMaxWaitTimeoutSeconds` | Standardmaksimal ventetid for værktøjsjobs i sekunder (30 som standard); individuelle kald kan tilsidesætte den. |
| `-Environment`                  | Standardkørselsmiljø.                                                                                            |
| `-Computer`                     | Standardmål for computer eller computergruppe.                                                                   |
| `-ComputerName`                 | URL eller værtsnavn for mål-PSU-serveren (alias `-Uri`), ikke værktøjets udførelsesmål.                          |
| `-AppToken`                     | App-token til Management API.                                                                                    |
| `-Credential`                   | Legitimationsoplysninger til Basic-godkendelse mod Management API.                                               |
| `-UseDefaultCredentials`        | Bruger de aktuelle Windows-legitimationsoplysninger.                                                             |
| `-Integrated`                   | Bruger den integrerede administrationsklient i processen.                                                        |
| `-TrustCertificate`             | Ignorerer fejl ved certifikatvalidering.                                                                         |
| `-Cookies`                      | Genbruger sessionscookies til godkendelse.                                                                       |

## Input

Ingen.

## Output

`PowerShellUniversal.Models.Intelligence.AiTool`.

## Tilladelser

Adgangstokenet kræver `intelligence.tools/create` for at køre denne cmdlet eksternt.


---

# 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://docs.devolutions.net/powershell-universal/da/powershell-kommandoer/new-psuaitool.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.
