Test

Synopsis

Check how functions work.

Syntax

Test-TestFunction -FunctionExpression <String> -StatusText <String> -HTTPVersion <String> [-Headers <String[]>] [-Cookies <String[]>] [-Variables <String[]>] [-EdgeRCFile <String>] [-Section <String>] [-AccountSwitchKey <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
Test-TestFunction -Body <Object> [-EdgeRCFile <String>] [-Section <String>] [-AccountSwitchKey <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]

Description

Runs a created function on sample data to check whether it returns the expected value.

The function is valid for use in a test case if the response's result value returns only one value.

Parameters

‑AccountSwitchKey

An account credential key that lets you move between accounts when using an API client enabled for multiple accounts. To find account switch keys, use Get-AccountSwitchKey.

‑Body
Conditionally required

A request body, either as a PSCustomObject or string. This parameter supports pipelining.

‑Cookies

One or more strings in the format key=value, e.g. "mycookie=true".

‑EdgeRCFile

Your EdgeGrid resource file to authenticate your command. Defaults to ~/.edgerc.

‑FunctionExpression
Conditionally required

Function expression you want to test. To learn more about supported functions, see Available functions.

‑HTTPVersion
Conditionally required

HTTP version.

‑Headers

One or more strings in the format key=value, e.g. "content-type=application/json".

‑Section

The section name in your EdgeGrid resource file to retrieve authentication credentials from. Defaults to default.

‑StatusText
Conditionally required

HTTP status text.

‑Variables

Variable used in functionExpression.

Related Links