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

# Set-PSUScript

Set-PSUScript opdaterer et scripts navn, indhold, timeout, status, fejlhandling, noter, mærker eller andre egenskaber i PowerShell Universal.

## Synopsis

Angiver egenskaber for et script.

## Syntaks

### Id

```
Set-PSUScript [-Id] <Int64> [-Name <String>] [-Description <String>] [-ManualTime <Double>] [-TimeOut <Double>]
 [-Status <String>] [-Content <String>] [-Notes <String>] [-Environment <String>]
 [-DisableManualInvocation <Boolean>] [-ScriptErrorAction <ActionPreference>] [-MaxHistory <Int32>]
 [-Tag <Tag[]>] [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>]
 [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]
```

### Script

```
Set-PSUScript [-Script] <Script> [-Name <String>] [-Description <String>] [-ManualTime <Double>]
 [-TimeOut <Double>] [-Status <String>] [-Content <String>] [-Notes <String>] [-Environment <String>]
 [-DisableManualInvocation <Boolean>] [-ScriptErrorAction <ActionPreference>] [-MaxHistory <Int32>]
 [-Tag <Tag[]>] [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>]
 [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]
```

### ScriptBlock

```
Set-PSUScript [-Name <String>] [-Description <String>] [-ManualTime <Double>] [-TimeOut <Double>]
 [-Status <String>] [-Content <String>] [-ScriptBlock <ScriptBlock>] [-Notes <String>] [-Environment <String>]
 [-DisableManualInvocation <Boolean>] [-ScriptErrorAction <ActionPreference>] [-MaxHistory <Int32>]
 [-Tag <Tag[]>] [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>]
 [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]
```

## Beskrivelse

Angiver egenskaber for et script. Egenskaberne gemmes både i databasen og i git-lageret.

## Eksempler

### Eksempel 1

```
PS C:\> $Script = Get-UAScript -Name 'Script1.ps1'
PS C:\> Set-UAScript -Script $Script -Description 'My favorite script' -ManualTime 123
```

Angiver beskrivelsen og den manuelle tid for Script1.ps1.

## Parametre

### -AppToken

Et app-token til at få adgang til PSU-API'en.

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

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

### -ComputerName

HTTP-adressen på PSU REST API-serveren.

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

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

### -Content

Indholdet af scriptet.

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

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

### -Description

Beskrivelsen af scriptet.

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

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

### -DisableManualInvocation

Forhindrer dette script i at køre manuelt. Det kan kun køres efter en tidsplan.

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

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

### -Environment

Angiver det udførelsesmiljø, der skal bruges.

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

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

### -Id

Id'et for det script, der skal angives.

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

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

### -Integrated

Udfører kommandoen internt i stedet for at bruge Management API. Virker kun, når scriptet køres inde fra PowerShell Universal.

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

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

### -ManualTime

Den manuelle udførelsestid for dette script.

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

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

### -MaxHistory

Angiver det maksimale antal historiske poster, der skal bevares.

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

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

### -Name

Navnet på dette script.

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

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

### -Notes

Noter, der skal medtages med dette script.

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

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

### -Script

Det script, som der skal angives egenskaber på. Brug Get-UAScript til at hente et Script-objekt.

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

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

### -ScriptBlock

Den scriptblok, der bruges til at angive scriptets indhold.

```yaml
Type: ScriptBlock
Parameter Sets: ScriptBlock
Aliases:

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

### -ScriptErrorAction

Angiver, hvordan PowerShell Universal håndterer scriptfejl under kørsel.

```yaml
Type: ActionPreference
Parameter Sets: (All)
Aliases:
Accepted values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend, Break

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

### -Status

Scriptets status. Dette bruges ikke i øjeblikket.

```yaml
Type: String
Parameter Sets: (All)
Aliases:
Accepted values: Draft, Pending Review, Pending, Review, Published, Disabled

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

### -Tag

Angiver mærkerne for et script.

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

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

### -TimeOut

Angiver den maksimale tid, i sekunder, som scriptet kan køre.

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

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

### -UseDefaultCredentials

Brug standardlegitimationsoplysninger, når der oprettes forbindelse til Management API

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

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

### -Credential

Legitimationsoplysninger til at logge på PowerShell Universal Management API.

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

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

### -TrustCertificate

Om cmdlet'en skal ignorere certifikatproblemer.

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

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

### -Cookies

Genbruger og bevarer godkendelsescookies for den aktuelle PowerShell-session.

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

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

### CommonParameters

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

## Input

### UniversalAutomation.Script

## Output

### System.Object

## Noter

## Relaterede links

## Tilladelser

Adgangstokenet kræver `automation.scripts.<script path>/update` for at køre denne cmdlet eksternt. Omdøbning eller flytning af et script kræver opdateringsadgang til både den oprindelige sti og destinationsstien.


---

# 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/set-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.
