> 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

## ÜBERSICHT

Ruft ein Skript innerhalb von PSU auf.

## SYNTAX

### Script

```
Invoke-PSUScript [-Script] <Script> [-WaitForDebugger] [-Environment <String>] [-Notes <String>]
 [-Credential <Variable>] [-Wait] [-Queue <String>] [-WaitTimeout <Int32>] [-Parameters <Hashtable>]
 [-Tags <Tag[]>] [-Silent] [-ComputerName <String>] [-AppToken <String>] [-UseDefaultCredentials] [-Integrated]
 [-TrustCertificate] [-Cookies] [<CommonParameters>]
```

### Id

```
Invoke-PSUScript [-Id] <Int64> [-WaitForDebugger] [-Environment <String>] [-Notes <String>]
 [-Credential <Variable>] [-Wait] [-Queue <String>] [-WaitTimeout <Int32>] [-Parameters <Hashtable>]
 [-Tags <Tag[]>] [-Silent] [-ComputerName <String>] [-AppToken <String>] [-UseDefaultCredentials] [-Integrated]
 [-TrustCertificate] [-Cookies] [<CommonParameters>]
```

### Name

```
Invoke-PSUScript [-WaitForDebugger] [-Environment <String>] [-Notes <String>] [-Credential <Variable>]
 [-Name] <String> [-Wait] [-Queue <String>] [-WaitTimeout <Int32>] [-Parameters <Hashtable>] [-Tags <Tag[]>]
 [-Silent] [-ComputerName <String>] [-AppToken <String>] [-UseDefaultCredentials] [-Integrated]
 [-TrustCertificate] [-Cookies] [<CommonParameters>]
```

## BESCHREIBUNG

Ruft ein Skript innerhalb von PSU auf. Das Aufrufen eines Skripts startet einen neuen Job, dessen Fortschritt Sie anschließend verfolgen können.

## BEISPIELE

### Beispiel 1

```
PS C:\> $Script = Get-PSUScript -Name 'Script1.ps1'
PS C:\> Invoke-PSUScript -Script $Script
```

Ruft 'Script1.ps1' auf

### Beispiel 2

```
PS C:\> $Script = Get-PSUScript -Name 'Script1.ps1'
PS C:\> Invoke-PSUScript -Script $Script -Parameter1 123 -Parameter2 "Test"
```

Ruft 'Script1.ps1' mit den Parametern Parameter1 und Parameter2 auf. Diese Parameter werden an das Skript übergeben. Invoke-PSUScript unterstützt eine beliebige Anzahl dynamischer Parameter.

### Beispiel 3

```
PS C:\> $Script = Get-PSUScript -Name 'Script1.ps1'
PS C:\> $Password = Get-UAVariable -Name 'UserPassword'
PS C:\> $Credential = New-UDCredential -UserName 'adam' -Password $Password
PS C:\> Invoke-PSUScript -Script $Script -Credential $Credential
```

Ruft 'Script1.ps1' als Benutzer 'adam' auf. Passwörter werden von Secret-Managern abgerufen und können nicht als Zeichenfolgen übergeben werden.

## PARAMETER

### -AppToken

Ein App-Token für den Zugriff auf die PSU-API.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -ComputerName

Die HTTP-Adresse des PSU-REST-API-Servers.

```yaml
Type: String
Parameter Sets: (All)
Aliases: Uri

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Credential

Die Anmeldeinformationen des Benutzers, unter dem das Skript ausgeführt werden soll. Verwenden Sie New-UACredential, um diese Anmeldeinformationen zu erstellen.

```yaml
Type: Variable
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Environment

Die Umgebung, die beim Aufrufen dieses Skripts verwendet werden soll. Verfügbare Umgebungen können Sie mit Get-PSUEnvironment anzeigen.

```yaml
Type: String
Parameter Sets: (All)
Aliases: PowerShellVersion

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Id

Die ID des aufzurufenden Skripts.

```yaml
Type: Int64
Parameter Sets: Id
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```

### -Integrated

Führt den Befehl intern aus, anstatt die Management-API zu verwenden. Funktioniert nur, wenn das Skript innerhalb von PowerShell Universal ausgeführt wird.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Name

Der Name des aufzurufenden Skripts.

```yaml
Type: String
Parameter Sets: Name
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Notes

Notizen, die bei der Job-Ausführung eingeschlossen werden sollen.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Script

Das aufzurufende Skript. Verwenden Sie Get-PSUScript, um vorhandene Skripte abzurufen.

```yaml
Type: Script
Parameter Sets: Script
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```

### -UseDefaultCredentials

Standard-Anmeldeinformationen bei der Verbindung mit der Management-API verwenden

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Wait

Wartet auf die Ausführung des Skripts, bevor zurückgegeben wird.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -WaitForDebugger

Nicht verwendet.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
```

### -Queue

Der Computer, die Computergruppe oder die Warteschlange, für die dieses Skript ausgeführt werden soll.

```yaml
Type: String
Parameter Sets: (All)
Aliases: ComputerGroup

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Parameters

Eine Hashtable von Parametern, die an das Skript übergeben werden. Diese kann anstelle dynamischer Parameter dieses Cmdlets verwendet werden.

```yaml
Type: Hashtable
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -WaitTimeout

Die Anzahl der Sekunden, die gewartet werden soll.

```yaml
Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Silent

Verhindert die Interaktion mit dem aktuellen PowerShell-Host. Schreibt nicht in Streams und ruft Read-Host nicht auf.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Tags

Tags, die auf den Job angewendet werden sollen.

```yaml
Type: Tag[]
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -TrustCertificate

Ob das Cmdlet Zertifikatsprobleme ignorieren soll.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Cookies

Verwendet Authentifizierungs-Cookies für die aktuelle PowerShell-Sitzung erneut und speichert sie dauerhaft.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters

Dieses Cmdlet unterstützt die allgemeinen Parameter: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -Verbose, -WarningAction, -WarningVariable und -ProgressAction. Weitere Informationen finden Sie unter [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

## EINGABEN

### UniversalAutomation.Script

### System.Int64

## AUSGABEN

### System.Object

## HINWEISE

## VERWANDTE LINKS

[Get-PSUEnvironment](/powershell-universal/de/powershell-befehle/get-psuenvironment.md)


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.devolutions.net/powershell-universal/de/powershell-befehle/invoke-psuscript.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
