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

New-PSUAiAgent

Creates a new AI agent definition.

SYNOPSIS

Creates a new AI agent definition.

SYNTAX

New-PSUAiAgent [-Name] <String> [-Description <String>] [-Instructions <String>] [-Model <String>]
 [-ApiKey <Variable>] [-Tool <String[]>] [-ComputerName <String>] [-AppToken <String>]
 [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies]
 [<CommonParameters>]

DESCRIPTION

Builds an AI agent definition from the supplied parameters and persists it in PowerShell Universal. The created agent can define model metadata, instructions, an API key variable, and the tools the agent may invoke.

EXAMPLES

Example 1

PS C:\> New-PSUAiAgent -Name SupportAgent -Description "Tier 1 assistant" -Instructions "Answer from the knowledge base first." -Model gpt-4o-mini -Tool GetUsers,GetTickets

Creates an AI agent named SupportAgent that can use the GetUsers and GetTickets tools.

PARAMETERS

-ApiKey

Specifies the PSU variable that contains the API key used by the AI agent.

-AppToken

Specifies the app token to use when authenticating to the PowerShell Universal management API.

-ComputerName

Specifies the URL or host name of the target PowerShell Universal instance. Bare host names are normalized to an http://:5000 URL.

-Cookies

Reuses and persists authentication cookies for the current PowerShell session.

-Credential

Specifies the credentials to use for Basic authentication against the PowerShell Universal management API.

-Description

Specifies a description for the resource.

-Instructions

Specifies the system instructions or operating guidance the AI agent follows when generating responses.

-Integrated

Uses the in-process integrated management client when the cmdlet runs inside PowerShell Universal.

-Model

Specifies the AI model identifier the agent should use for completions.

-Name

Specifies the name of the resource.

-Tool

Specifies the names of the AI tools the agent can use.

-TrustCertificate

Allows connections to servers with untrusted TLS certificates.

-UseDefaultCredentials

Uses the current Windows credentials when authenticating to the management API.

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

Last updated

Was this helpful?