Skip to content

Command Reference

Miriam McMahon edited this page Sep 1, 2023 · 27 revisions

The following table list the various scripting commands with a short description and an example usage. These commands can be used to organise the script logic, communicate with the remote host, and manipulate data retrieved from the remote host.

Click on a command name to show full details of the command, its usage, and its parameters.

A command parameter can be of a fixed type (e.g. string, boolean) or of type 'Value'. A 'Value' can contain a variable, and the actual type will depend on the type of the variable. If the actual type does not match the expected resolved type defined for the parameter, then an error will occur. For more details about resolving variables see Variable Reference

Command Description
BaseAddress Set the base address for future HTTP requests
ClearCookie Clear a cookie from the cookie storage to eliminate it from future requests
Comment A comment placeholder in the script.
ComparePasswordHash Compare a password hash obtained from a remote system with a hash generated from a password locally.
Condition A logic component, that will run commands based on evaluation of an expression.
Connect Connect to a remote host to establish an interactive session using SSH, Telnet or Tn3270.
Disconnect Disconnect an SSH, Telnet or Tn3270 connection from a remote host.
DiscoverSshHostKey Retrieve the SSH host key of a remote host (SSH only).
CryptMd5 MD5 encrypt a string
Eval A logic component that will evaluate/execute an in-line expression.
Execute Command Execute a command on the remote host
ExtractFormData Extract form inputs from a HTML page
ExtractJsonObject Convert a JSON text string into a JSON object
For A logic component that will execute a block of commands in a loop.
ForEach A logic component that will execute a block of commands on each element in a collection of items.
Function A logic component that can be used to define a reusable function that executes a block of commands.
GetCookie Get the value of a cookie
GetFormValue Get the value of a form input from a form object
Headers Add or edit HTTP request headers
HttpAuth Define the authentication method to use with an HTTP request
Log Write a message to the operation log.
NewHttpRequest Create a new HTTP request object.
Receive Receive data via SSH, Telnet or TN3270 from an interactive session with a remote host.
Request Issue a HTTP request.
Return A logic component to return a value from a function or operation.
Send Send data via SSH, Telnet or TN3270 in an interactive session with a remote host.
SetCookie Add or update a cookie
SetItem Create or update an internal variable and its value.
SetFormValue Set the value of a form input
Split A logic component that splits the string contents of a variable or a string into substrings based on the delimiter characters supplied.
Status Publish a progress status message via the framework.
Switch A logic component that allows the contents of a variable to be tested for a match against a list of values. Each value is called a case and the variable being switched on is checked for each case. If defined, the DefaultCase is executed if no match is found.
Throw The throw command logs the associated message and bubbles execution up to a try catch finally block. If the exception is not handled within the script, the code invoking the operation handles it and the operation is considered to have failed.
Try A logic component that can be used to control the behaviour when an error ocuccrs. The try block is used to encapsulate commands. If any command throws within that try block, it will be handled by the corresponding catch. The finally block allows contained commands to execute regardless of any throws in the try block.
UrlDecode Convert a URL-encoded string into a decoded string
UrlEncode Convert a text string into a URL-encoded string
Wait A logic component that will pause execution of the script for the indicated number of seconds.
WriteDiscoveredAccount A mechanism for the script to return account discovery information to the client.
WriteResponseObject A mechanism for the script to return arbitrary data to the client.
WriteDiscoveredService A mechanism for the script to return service discovery information to the client.
WriteDiscoveredSshKey A mechanism for the script to return discovered authorized key information to the client.