For the complete documentation index, see llms.txt. This page is also available as Markdown.

Invoke-PSUTerminalCommand

Invokes a command in a terminal instance.

SYNOPSIS

Invokes a command in a terminal instance.

SYNTAX

Invoke-PSUTerminalCommand -TerminalInstance <TerminalInstance> -Command <String> [-ComputerName <String>]
 [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate]
 [-Cookies] [<CommonParameters>]

DESCRIPTION

Invokes a command in a terminal instance. You can start new terminal instances with Start-PSUTerminalInstance and return running instances with Get-PSUTerminalInstance.

EXAMPLES

Example 1

PS C:\> $Terminal = Get-PSUTerminal | Where-Object Name -eq 'Terminal1'
PS C:\> Start-PSUTerminalInstance -Terminal $Terminal 
PS C:\> $Instance = Get-PSUTerminalInstance
PS C:\> Invoke-PSUTerminalCommand -TerminalInstance $Instance -Command 'Write-Host "Hello, World!"'

Creates a new terminal instance of Terminal1 and then invokes a command within it.

PARAMETERS

-AppToken

An App Token for authenticating against the PowerShell Universal server.

-Command

The command to invoke

-ComputerName

The name or URL of the PowerShell Universal server.

-Integrated

Not Supported

-TerminalInstance

The terminal instance within which to invoke the command. Use Get-PSUTerminalInstance to return running instances.

-UseDefaultCredentials

The terminal configuration to start. Use Get-PSUTerminal to return terminal configurations.

-Credential

Credentials to login to the PowerShell Universal Management API.

-TrustCertificate

Whether the cmdlet should ignore certificate issues.

-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

PowerShellUniversal.TerminalInstance

OUTPUTS

System.Object

NOTES

Last updated

Was this helpful?