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
DESCRIPTION
Creates a new app in PowerShell Universal.
EXAMPLES
Example 1
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.
-Authenticated
When specified, authentication is enabled for this app.
-AutoDeploy
Whether to deploy this app when changes are made. If not specified, the app needs to be restarted before changes are applied.
-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.
-Command
The command used to create this app.
-Component
Not used. Only present for backwards compatibility.
-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.
-Content
The content of this app.
-Credential
The user credential to run this app under.
-Description
A description of this app.
-DisableAutoStart
Whether to disable auto starting this app when the server starts.
-DisableErrorToast
Whether to disable error toasts for this app.
-DisableInteractiveHost
Whether to disable the interactive host for this app. Write-Host, Read-Host, Get-Credential and other features will no longer work.
-DisableStartupLog
Whether to disable the startup log for this app.
-Environment
The environment to run this app under.
-FavIcon
The URL to the favicon for this app.
-FilePath
The path to the file that contains the content for this app.
-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.
-IdleTimeout
The idle timeout for this app.
-Integrated
Executes the command internally rather than using the Management API. Only works when running script from within PowerShell Universal.
-Maintenance
Whether to put this app into maintenance mode. Only administrators will be able to access the app when in maintenance mode.
-Module
The module that contains the command used to define this app.
-Name
The name of this app.
-Role
Roles that have access to this app.
-SessionTimeout
The session timeout for this app.
-Tag
Tags to apply to this app.
-UseDefaultCredentials
Use default credentials when connecting to the management API
-VerboseErrorMessages
Whether to display verbose error messages for this app.
-ComputerGroup
Specifies the computer group to target or assign.
-OnSessionTimeout
Specifies the script block to run when an app session times out.
-AvailableInBranch
When specified, this app will only be displayed and running the specified branches.
-TrustCertificate
Whether the cmdlet should ignore certificate issues.
-Critical
App is critical. This will cause the /api/v1/status endpoint to return a 500 if the app did not start.
-Cookies
Reuses and persists authentication cookies for the current PowerShell session.
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.
INPUTS
None
OUTPUTS
System.Object
NOTES
RELATED LINKS
PERMISSIONS
The access token requires apps/create to run this cmdlet remotely.
Last updated
Was this helpful?