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

New-PSUAiAgent

SYNOPSIS

Creates a new AI agent definition.

SYNTAX

New-PSUAiAgent -Name <String> [-Description <String>] [-Instructions <String>] [-Model <String>] [-ApiKey <Variable>] [-Provider <AiProvider>] [-Endpoint <String>] [-Tool <String[]>] [-Role <String[]>] [-AvailableInChat] [<ConnectionOptions>] [<CommonParameters>]

<ConnectionOptions>: [-ComputerName <String>] [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate] [-Cookies].

DESCRIPTION

Builds and persists an AI agent with model metadata, instructions, an API-key variable, and allowed tools. The provider defaults to OpenAI; Anthropic and Custom are also supported. A Custom provider requires an absolute -Endpoint URL. Use -AvailableInChat to expose the agent in admin and generated-app chat pickers.

EXAMPLES

New-PSUAiAgent -Name SupportAgent -Description 'Tier 1 assistant' -Instructions 'Answer from the knowledge base first.' -Model gpt-4o-mini -Tool GetUsers,GetTickets
New-PSUAiAgent -Name SupportAgent -Model gpt-4o-mini -Instructions 'Answer from the knowledge base first.' -Tool GetTickets -AvailableInChat

PARAMETERS

Parameter
Description

-Name

Required agent name.

-Description

Agent description.

-Instructions

System instructions for the agent.

-Model

Model identifier used for completions.

-ApiKey

PSU variable holding the provider API key.

-Provider

AI provider: OpenAI (default), Anthropic, or Custom.

-Endpoint

Absolute provider URL; required when -Provider Custom.

-Tool

Names of tools the agent may invoke (alias -Tools).

-Role

Roles allowed to access the agent (alias -Roles).

-AvailableInChat

Makes the agent selectable in chat pickers.

-ComputerName

Target server URL or host name (alias -Uri).

-AppToken

Management API app token.

-Credential

Credentials for Management API Basic authentication.

-UseDefaultCredentials

Uses current Windows credentials.

-Integrated

Uses the in-process management client.

-TrustCertificate

Ignores certificate validation errors.

-Cookies

Reuses session authentication cookies.

INPUTS

None.

OUTPUTS

PowerShellUniversal.Models.Intelligence.AiAgent.

PERMISSIONS

The access token requires intelligence.agents/create to run this cmdlet remotely.

Last updated

Was this helpful?