> 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/de/powershell-befehle/new-psutrigger.md).

# New-PSUTrigger

New-PSUTrigger erstellt einen Automatisierungs-Trigger in PowerShell Universal, der ein Skript als Reaktion auf Ereignisse wie Job-Fehler oder Dashboard-Stopps ausführt.

## SYNOPSIS

Erstellt einen Automatisierungs-Trigger.

## SYNTAX

```powershell
New-PSUTrigger -Name <String> -EventType <EventType> -TriggerScript <Script> [-Script <Script>] [-Scripts <Script[]>] [-Dashboard <Dashboard>] [-Environment <String>] [-Delay <Int32>] [-Computer <String>] [-Condition <ScriptBlock>] [-Parameters <Hashtable>] [<ConnectionOptions>] [<CommonParameters>]
```

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

## BESCHREIBUNG

Erstellt einen Trigger, der ein Trigger-Skript für PSU-Ereignisse ausführt. Verwenden Sie `-Script` oder `-Scripts`, um einem oder mehreren Skripts Jobereignis-Trigger zuzuordnen; wenn beide angegeben sind, hat `-Scripts` Vorrang. `-Parameters` übergibt eine Hashtable an das Trigger-Skript und löst dessen deklarierte Parameter auf. Optional können Sie die Ausführung mit `-Condition` filtern.

## BEISPIEL

```powershell
New-PSUTrigger -Name 'Build failures' -EventType JobFailed -Scripts 'Build.ps1','Deploy.ps1' -TriggerScript 'Notify.ps1' -Parameters @{ Channel = 'ops' }
```

## PARAMETER

| Parameter                | Beschreibung                                                            |
| ------------------------ | ----------------------------------------------------------------------- |
| `-Name`                  | Erforderlicher Triggername.                                             |
| `-EventType`             | Erforderlicher PSU-Ereignistyp, der den Trigger auslöst.                |
| `-TriggerScript`         | Erforderliches Skript, das ausgeführt wird, wenn das Ereignis eintritt. |
| `-Script`                | Ein zugeordnetes Skript für die Ereignisfilterung.                      |
| `-Scripts`               | Mehrere zugeordnete Skripts für die Ereignisfilterung.                  |
| `-Dashboard`             | Dem Ereignis zugeordnete App.                                           |
| `-Environment`           | Ausführungsumgebung des Trigger-Skripts.                                |
| `-Delay`                 | Verzögerung vor der Ausführung des Triggers.                            |
| `-Computer`              | Ausführungscomputer oder -gruppe.                                       |
| `-Condition`             | Skriptblockbedingung, die erfüllt sein muss.                            |
| `-Parameters`            | Parameterwerte für das Trigger-Skript.                                  |
| `-ComputerName`          | URL oder Hostname der Ziel-PSU-Verwaltungs-API (Alias `-Uri`).          |
| `-AppToken`              | App-Token der Verwaltungs-API.                                          |
| `-Credential`            | Anmeldeinformationen der Verwaltungs-API.                               |
| `-UseDefaultCredentials` | Verwendet die aktuellen Windows-Anmeldeinformationen.                   |
| `-Integrated`            | Verwendet den prozessinternen Verwaltungsclient.                        |
| `-TrustCertificate`      | Ignoriert Fehler bei der Zertifikatsvalidierung.                        |
| `-Cookies`               | Verwendet die Authentifizierungscookies der Sitzung erneut.             |

## BERECHTIGUNGEN

Das Zugriffstoken erfordert `automation.triggers/create`, um dieses Cmdlet remote auszuführen.


---

# 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/de/powershell-befehle/new-psutrigger.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.
