> 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/new-psuapp.md).

# New-PSUApp

New-PSUApp opretter en ny app i PowerShell Universal ud fra en filsti, scriptindhold eller et modul, med valgmuligheder for godkendelse og roller.

## Synopsis

Opretter en ny app i PowerShell Universal.

## Syntaks

### FilePath (standard)

```
New-PSUApp [-FilePath <String>] [-BaseUrl <String>] -Name <String> [-Environment <String>] [-GrantAppToken]
 [-Maintenance] [-Authenticated] [-Role <String[]>] [-DisableAutoStart] [-Component <DashboardComponent[]>]
 [-SessionTimeout <Int32>] [-IdleTimeout <Int32>] [-AutoDeploy] [-Description <String>] [-Credential <String>]
 [-DisableErrorToast] [-DisableStartupLog] [-VerboseErrorMessages] [-Tag <Tag[]>] [-DisableInteractiveHost]
 [-FavIcon <String>] [-OnSessionTimeout <ScriptBlock>] [-ComputerGroup <String[]>]
 [-AvailableInBranch <String[]>] [-Critical] [-ComputerName <String>] [-AppToken <String>]
 [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]
```

### Indhold

```
New-PSUApp -Content <ScriptBlock> [-BaseUrl <String>] -Name <String> [-Environment <String>] [-GrantAppToken]
 [-Maintenance] [-Authenticated] [-Role <String[]>] [-DisableAutoStart] [-Component <DashboardComponent[]>]
 [-SessionTimeout <Int32>] [-IdleTimeout <Int32>] [-AutoDeploy] [-Description <String>] [-Credential <String>]
 [-DisableErrorToast] [-DisableStartupLog] [-VerboseErrorMessages] [-Tag <Tag[]>] [-DisableInteractiveHost]
 [-FavIcon <String>] [-OnSessionTimeout <ScriptBlock>] [-ComputerGroup <String[]>]
 [-AvailableInBranch <String[]>] [-Critical] [-ComputerName <String>] [-AppToken <String>]
 [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]
```

### Modul

```
New-PSUApp [-BaseUrl <String>] -Name <String> [-Environment <String>] [-GrantAppToken] [-Maintenance]
 [-Authenticated] [-Role <String[]>] [-DisableAutoStart] [-Component <DashboardComponent[]>]
 [-SessionTimeout <Int32>] [-IdleTimeout <Int32>] [-AutoDeploy] [-Description <String>] [-Credential <String>]
 [-DisableErrorToast] [-DisableStartupLog] [-VerboseErrorMessages] [-Tag <Tag[]>] [-DisableInteractiveHost]
 [-Module <String>] [-Command <String>] [-FavIcon <String>] [-OnSessionTimeout <ScriptBlock>]
 [-ComputerGroup <String[]>] [-AvailableInBranch <String[]>] [-Critical] [-ComputerName <String>]
 [-AppToken <String>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]
```

## Beskrivelse

Opretter en ny app i PowerShell Universal.

## Eksempler

### Eksempel 1

```powershell
New-PSUApp -Name 'App' -BaseUrl '/app' -FilePath "app.ps1"
```

Opretter en app ved hjælp af filen app.ps1 i lagerkataloget og serverer den på basis-URL'en /app.

## Parametre

### -AppToken

Det AppToken, der bruges til at kalde PowerShell Universal Management API. De kan også kalde Connect-PSUServer, før De kalder denne cmdlet, for at angive AppToken for hele sessionen.

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

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

### -Authenticated

Når det er angivet, aktiveres godkendelse for denne app.

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

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

### -AutoDeploy

Om denne app skal udrulles, når der foretages ændringer. Hvis det ikke er angivet, skal appen genstartes, før ændringerne anvendes.

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

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

### -BaseUrl

Basis-URL'en til adgang til denne app. De kan bruge / til at levere appen i roden af serveren eller /app til at levere appen på /app.

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

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

### -Command

Den kommando, der bruges til at oprette denne app.

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

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

### -Component

Bruges ikke. Er kun medtaget af hensyn til bagudkompatibilitet.

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

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

### -ComputerName

Angiver det computernavn eller den URL, der skal kaldes, når PowerShell Universal Management API tilgås. De kan også bruge Connect-PSUServer, før De kalder denne cmdlet, for at angive computernavnet for hele sessionen.

```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 denne app.

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

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

### -Credential

Den legitimationsoplysning for brugeren, som denne app skal køre under.

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

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

### -Description

En beskrivelse af denne app.

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

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

### -DisableAutoStart

Om automatisk start af denne app skal deaktiveres, når serveren starter.

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

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

### -DisableErrorToast

Om fejltoastmeddelelser skal deaktiveres for denne app.

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

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

### -DisableInteractiveHost

Om den interaktive vært skal deaktiveres for denne app. Write-Host, Read-Host, Get-Credential og andre funktioner vil ikke længere fungere.

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

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

### -DisableStartupLog

Om opstartsloggen skal deaktiveres for denne app.

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

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

### -Environment

Det miljø, som denne app skal køres under.

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

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

### -FavIcon

URL'en til faviconet for denne app.

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

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

### -FilePath

Stien til den fil, der indeholder indholdet til denne app.

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

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

### -GrantAppToken

Om der skal tildeles et app-token til brugere af denne app. De kan bruge app-tokenet i Deres app til at få adgang til ressourcer i PSU som den bruger, der logger på.

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

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

### -IdleTimeout

Den inaktive timeout for denne app.

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

Required: False
Position: Named
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
```

### -Maintenance

Om denne app skal sættes i vedligeholdelsestilstand. Kun administratorer kan få adgang til appen, når den er i vedligeholdelsestilstand.

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

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

### -Module

Det modul, der indeholder den kommando, der bruges til at definere denne app.

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

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

### -Name

Navnet på denne app.

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

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

### -Role

Roller, der har adgang til denne app.

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

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

### -SessionTimeout

Sessionstimeouten for denne app.

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

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

### -Tag

Mærker, der skal anvendes på denne app.

```yaml
Type: Tag[]
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
```

### -VerboseErrorMessages

Om der skal vises udførlige fejlmeddelelser for denne app.

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

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

### -ComputerGroup

Angiver den computergruppe, der skal målrettes eller tildeles.

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

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

### -OnSessionTimeout

Angiver den scriptblok, der skal køres, når en app-session får timeout.

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

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

### -AvailableInBranch

Når det er angivet, vises og køres denne app kun i de angivne grene.

```yaml
Type: String[]
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
```

### -Critical

App er kritisk. Dette medfører, at slutpunktet /api/v1/status returnerer en 500, hvis appen ikke startede.

```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

### Ingen

## Output

### System.Object

## Noter

## Relaterede links

## Tilladelser

Adgangstokenet kræver `apps/create` for at køre denne cmdlet eksternt.


---

# 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/new-psuapp.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.
