> 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/invoke-psuscript.md).

# Invoke-PSUScript

Invoke-PSUScript startet einen neuen Auftrag zur Ausführung eines Skripts in PowerShell Universal und gibt einen Auftrag zurück, dessen Fortschritt und Ausgabe Sie verfolgen können.

## SYNOPSIS

Startet einen neuen PowerShell Universal-Auftrag für ein Skript.

## SYNTAX

```powershell
Invoke-PSUScript -Script <Script> [-Environment <String>] [-Credential <Variable>] [-Notes <String>] [-WaitForDebugger] [-Wait] [-WaitTimeout <Int32>] [-Queue <String>] [-Parameters <Hashtable>] [-Tags <Tag[]>] [-Silent] [<ConnectionOptions>] [<CommonParameters>]
Invoke-PSUScript -Id <Int64> [-Environment <String>] [-Credential <Variable>] [-Notes <String>] [-WaitForDebugger] [-Wait] [-WaitTimeout <Int32>] [-Queue <String>] [-Parameters <Hashtable>] [-Tags <Tag[]>] [-Silent] [<ConnectionOptions>] [<CommonParameters>]
Invoke-PSUScript -Name <String> [-Environment <String>] [-Credential <Variable>] [-Notes <String>] [-WaitForDebugger] [-Wait] [-WaitTimeout <Int32>] [-Queue <String>] [-Parameters <Hashtable>] [-Tags <Tag[]>] [-Silent] [<ConnectionOptions>] [<CommonParameters>]
```

`<ConnectionOptions>`: `[-ComputerName <String>] [-AppToken <String>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]`. Skriptparameter werden nach Möglichkeit auch dynamisch verfügbar gemacht.

## BESCHREIBUNG

Startet einen Job, der über die Job-Cmdlets nachverfolgt werden kann. Wählen Sie ein Skript nach Name, ID oder Skriptobjekt aus (das Objekt akzeptiert Pipelineeingabe). Normale Skriptparameter werden dynamisch verfügbar gemacht. Ausgeblendete Skriptparameter werden absichtlich nicht als dynamische Cmdlet-Parameter verfügbar gemacht, können aber über die Hashtable `-Parameters` angegeben werden und werden an das Skript übergeben. Hier ist `-Credential` eine PSU-Anmeldeinformations-*Variable* für den Job und kein `PSCredential` für die Authentifizierung an der Verwaltungs-API.

## BEISPIEL

```powershell
Invoke-PSUScript -Name 'Deploy.ps1' -Parameters @{ Region = 'westus'; InternalToken = $token }
```

## PARAMETER

| Parameter                | Beschreibung                                                                       |
| ------------------------ | ---------------------------------------------------------------------------------- |
| `-Script`                | Auszuführendes Skriptobjekt; akzeptiert Pipelineeingabe.                           |
| `-Id`                    | Numerische ID des auszuführenden Skripts; akzeptiert Pipelineeingabe.              |
| `-Name`                  | Name oder Pfad des auszuführenden Skripts.                                         |
| `-Environment`           | Überschreibung der Ausführungsumgebung (Alias `-PowerShellVersion`).               |
| `-Credential`            | Für den Job verwendete PSU-Anmeldeinformationsvariable.                            |
| `-Notes`                 | Mit dem Job gespeicherte Notizen.                                                  |
| `-WaitForDebugger`       | Wartet auf einen Debugger, bevor der Job ausgeführt wird.                          |
| `-Wait`                  | Wartet, bis der Job abgeschlossen ist.                                             |
| `-WaitTimeout`           | Timeout für das Warten, in Sekunden.                                               |
| `-Queue`                 | Jobwarteschlange oder Computergruppe (Alias `-ComputerGroup`).                     |
| `-Parameters`            | Hashtable der Skriptparameterwerte, einschließlich ausgeblendeter Skriptparameter. |
| `-Tags`                  | Tags, die dem Job zugeordnet werden.                                               |
| `-Silent`                | Unterdrückt die Ausführungsausgabe in der aktuellen Pipeline.                      |
| `-ComputerName`          | URL oder Hostname des Ziel-PSU-Servers (Alias `-Uri`).                             |
| `-AppToken`              | App-Token für die Verwaltungs-API.                                                 |
| `-UseDefaultCredentials` | Verwendet die aktuellen Windows-Anmeldeinformationen.                              |
| `-Integrated`            | Verwendet den prozessinternen Verwaltungsclient in PSU.                            |
| `-TrustCertificate`      | Ignoriert Fehler bei der Zertifikatsvalidierung.                                   |
| `-Cookies`               | Verwendet die Authentifizierungscookies für diese PowerShell-Sitzung erneut.       |

## BERECHTIGUNGEN

Das Zugriffstoken erfordert `automation.scripts.<script path>/execute`, um dieses Cmdlet remote auszuführen. Das Laden der Skriptparameter erfordert außerdem `automation.scripts.<script path>/read`. Die Suche nach dem Skript kann zusätzlich `automation.scripts/read` oder `automation.scripts.<name>/read` erfordern, wenn `-Name` verwendet wird. Ohne `-Wait` erfordert das Lesen des neuen Jobs `automation.jobs.<job ID>/read` oder die konfigurierte ReadPermission des Jobs.


---

# 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/invoke-psuscript.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.
