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

# Invoke-PSUCommand

Invoke-PSUCommand sender hændelser til en event hub eller en bestemt computer i PowerShell Universal og kører eventuelt en fjernkommando.

### Synopsis

Sender hændelser til en hændelseshub.

### Syntaks

```powershell
Invoke-PSUCommand [-AppToken <String>] [-ComputerName <String>] [-Data <Object>] -Hub <String> [-Integrated] [-UseDefaultCredentials] [-ConnectionId <String>] [-Credential <PSCredential>] [-TrustCertificate] [-Timeout <Int32>] [<CommonParameters>]

Invoke-PSUCommand [-AppToken <String>] [-ComputerName <String>] [-Data <Object>] [-Integrated] [-UseDefaultCredentials] -Computer <String> [-Credential <PSCredential>] [-TrustCertificate] [-Timeout <Int32>] [<CommonParameters>]

Invoke-PSUCommand [-AppToken <String>] [-ComputerName <String>] -Hub <String> [-Integrated] [-UseDefaultCredentials] [-ConnectionId <String>] [-Command <String>] [-Credential <PSCredential>] [-Parameters <Hashtable>] [-TrustCertificate] [-Timeout <Int32>] [<CommonParameters>]

Invoke-PSUCommand [-AppToken <String>] [-ComputerName <String>] [-Integrated] [-UseDefaultCredentials] [-Command <String>] -Computer <String> [-Credential <PSCredential>] [-Parameters <Hashtable>] [-TrustCertificate] [-Timeout <Int32>] [<CommonParameters>]
```

### Beskrivelse

Sender hændelser til en hændelseshub.

### Parametre

#### -AppToken

App-tokenet, der bruges ved adgang til PowerShell Universal-administrations-API'en.

```
Required?                    false
Position?                    named
Default value                None
Accept pipeline input?       False
Aliases                      none
Accept wildcard characters?  false
```

#### -ComputerName

URL'en eller værtsnavnet for PowerShell Universal-serveren.

```
Required?                    false
Position?                    named
Default value                None
Accept pipeline input?       False
Aliases                      Uri
Accept wildcard characters?  false
```

#### -Data

De data, der skal sendes til klienten. Disse data serialiseres til CliXml og deserialiseres på klienten.

```
Required?                    false
Position?                    named
Default value                None
Accept pipeline input?       False
Aliases                      none
Accept wildcard characters?  false
```

#### -Hub

Navnet på den hændelseshub, som hændelsen skal sendes til.

```
Required?                    true
Position?                    named
Default value                None
Accept pipeline input?       False
Aliases                      none
Accept wildcard characters?  false
```

#### -Integrated

Bruger den procesinterne administrationsklient ved kørsel inde i PowerShell Universal.

```
Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       False
Aliases                      none
Accept wildcard characters?  false
```

#### -UseDefaultCredentials

Bruger de aktuelle Windows-legitimationsoplysninger til at oprette forbindelse til PowerShell Universal.

```
Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       False
Aliases                      none
Accept wildcard characters?  false
```

#### -ConnectionId

Forbindelses-id'et, som hændelsen skal sendes til. Hvis det ikke er angivet, sendes hændelsen til alle forbundne klienter.

```
Required?                    false
Position?                    named
Default value                None
Accept pipeline input?       False
Aliases                      none
Accept wildcard characters?  false
```

#### -Command

Den kommando, der skal køres på agenten.

```
Required?                    false
Position?                    named
Default value                None
Accept pipeline input?       False
Aliases                      none
Accept wildcard characters?  false
```

#### -Computer

Den computer, som denne kommando skal køres på.

```
Required?                    true
Position?                    named
Default value                None
Accept pipeline input?       False
Aliases                      none
Accept wildcard characters?  false
```

#### -Credential

Legitimationsoplysninger til at logge på PowerShell Universal Management API.

```
Required?                    false
Position?                    named
Default value                None
Accept pipeline input?       False
Aliases                      none
Accept wildcard characters?  false
```

#### -Parameters

En hashtable med parametre, der skal sendes til kommandoen.

```
Required?                    false
Position?                    named
Default value                None
Accept pipeline input?       False
Aliases                      none
Accept wildcard characters?  false
```

#### -TrustCertificate

Om cmdlet'en skal ignorere certifikatproblemer.

```
Required?                    false
Position?                    named
Default value                False
Accept pipeline input?       False
Aliases                      none
Accept wildcard characters?  false
```

#### -Timeout

Timeouten i sekunder for kommandoens kørsel.

```
Required?                    false
Position?                    named
Default value                None
Accept pipeline input?       False
Aliases                      none
Accept wildcard characters?  false
```

#### Fælles parametre

Denne cmdlet understøtter de fælles parametre: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable og OutVariable. Se [about\_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216) for at få flere oplysninger.

### Input

Ingen

### Output

System.Object

### Noter

### Eksempler

#### Eksempel 1

```powershell
Invoke-PSUCommand -Hub 'MyHub' -Data @{ Name = 'Adam' }
```

Sender en hændelse til hændelseshubben MyHub. Alle tilsluttede klienter vil modtage hændelsen.

## Tilladelser

Adgangstokenet kræver `apis.eventhubs/execute` for at køre denne cmdlet eksternt. Dette gælder også, når kommandoen er rettet mod en computer eller en computergruppe.


---

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