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

Invoke-PSUEndpoint

Invokes a custom API endpoint internally.

SYNOPSIS

Invokes a custom API endpoint internally.

SYNTAX

Invoke-PSUEndpoint -Url <String> [-Headers <Hashtable>] [-Cookies <Hashtable>] [-Body <String>]
 [-Method <String>] [-ContentType <String>] [-ResponseVariable <String>] [-ComputerName <String>]
 [-AppToken <String>] [-Credential <PSCredential>] [-UseDefaultCredentials] [-Integrated] [-TrustCertificate]
 [<CommonParameters>]

DESCRIPTION

This cmdlet provides the ability to execute an endpoint without accessing the web server directly.

EXAMPLES

Example 1

PS C:\> Invoke-PSUEndpoint -URL '/myapi'

Returns an API endpoint internally.

PARAMETERS

-AppToken

An app token used to access the endpoint.

-Body

The body of the HTTP request.

-ComputerName

The name or URL of the PowerShell Universal server to access.

-ContentType

The HTTP content type header value. Defaults to application/json.

-Cookies

A hashtable of cookies to send to the API.

-Credential

Credentials to login to the PowerShell Universal Management API.

-Headers

A hashtable of headers to send to the API endpoint.

-Integrated

Whether to use the integrated security model.

-Method

The HTTP method of the API endpoint.

-TrustCertificate

Whether the cmdlet should ignore certificate issues.

-Url

The relative URL of the API endpoint.

-UseDefaultCredentials

Whether to use default credentials when connecting to PowerShell Universal. Requires Windows authentication to be enabled.

-ResponseVariable

Specifies the variable name that receives the full API response object after the endpoint is invoked. The response body is still written to the pipeline.

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?