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

# New-PSUApp

## SYNOPSIS

Creates a new app in PowerShell Universal.

## SYNTAX

### FilePath (Default)

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

### Content

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

### Module

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

## DESCRIPTION

Creates a new app in PowerShell Universal.

## EXAMPLES

### Example 1

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

Creates an app using the app.ps1 file in the repository directory and serves it at the base URL of /app.

## PARAMETERS

### -AppToken

The AppToken that is used for calling the PowerShell Universal Management API. You can also call Connect-PSUServer before calling this cmdlet to set the AppToken for the entire session.

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

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

### -Authenticated

When specified, authentication is enabled for this app.

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

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

### -AutoDeploy

Whether to deploy this app when changes are made. If not specified, the app needs to be restarted before changes are applied.

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

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

### -BaseUrl

The base URL to access this app. You can use / to serve the app at the root of the server or /app to serve the app at /app.

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

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

### -Command

The command used to create this app.

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

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

### -Component

Not used. Only present for backwards compatibility.

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

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

### -ComputerName

Specifies the computer name or URL that should be called when accessing the PowerShell Universal Management API. You can also use Connect-PSUServer before calling this cmdlet to set the computer name for the entire session.

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

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

### -Content

The content of this app.

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

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

### -Credential

The user credential to run this app under.

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

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

### -Description

A description of this app.

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

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

### -DisableAutoStart

Whether to disable auto starting this app when the server starts.

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

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

### -DisableErrorToast

Whether to disable error toasts for this app.

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

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

### -DisableInteractiveHost

Whether to disable the interactive host for this app. Write-Host, Read-Host, Get-Credential and other features will no longer work.

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

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

### -DisableStartupLog

Whether to disable the startup log for this app.

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

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

### -Environment

The environment to run this app under.

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

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

### -FavIcon

The URL to the favicon for this app.

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

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

### -FilePath

The path to the file that contains the content for this app.

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

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

### -GrantAppToken

Whether to grant an app token to users of this app. You can use the app token within your app to access resources of PSU as the user logging in.

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

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

### -IdleTimeout

The idle timeout for this app.

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

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

### -Integrated

Executes the command internally rather than using the Management API. Only works when running script from within 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

Whether to put this app into maintenance mode. Only administrators will be able to access the app when in maintenance mode.

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

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

### -Module

The module that contains the command used to define this app.

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

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

### -Name

The name of this app.

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

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

### -Role

Roles that have access to this app.

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

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

### -SessionTimeout

The session timeout for this app.

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

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

### -Tag

Tags to apply to this app.

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

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

### -UseDefaultCredentials

Use default credentials when connecting to the 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

Whether to display verbose error messages for this app.

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

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

### -ComputerGroup

Specifies the computer group to target or assign.

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

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

### -OnSessionTimeout

Specifies the script block to run when an app session times out.

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

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

### -AvailableInBranch

When specified, this app will only be displayed and running the specified branches.

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

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

### -TrustCertificate

Whether the cmdlet should ignore certificate issues.

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

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

### -Critical

App is critical. This will cause the /api/v1/status endpoint to return a 500 if the app did not start.

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

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

### -Cookies

Reuses and persists authentication cookies for the current 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

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -Verbose, -WarningAction, -WarningVariable, and -ProgressAction. For more information, see [about\_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

### None

## OUTPUTS

### System.Object

## NOTES

## RELATED LINKS


---

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