Previous Topic: get-help Command--Get Help Information (Funclet)Next Topic: get-webServiceInfo Command--Display WSDL Info (Cmdlet)


get-remoteResult Command--Get Result from a Remote Target (Funclet)

This funclet retrieves the result of a remote execution from a RemoteTarget object. The return value of a remote execution must be transferred over the network back to the system that originated the request. The result is serialized into an XML representation on the remote system and the RemoteTarget.result() method returns the result value in its serialized representation.

Turn the serialized representation into a regular JavaScript value using the get-remoteResult() funclet with the RemoteTarget object itself as a parameter. Typically there is no need for script to call result() directly. Serialization maintains type information, so when the remote node returns a number, get-remoteResult() returns a value of type number. If the remote system returns a Date object, it also becomes a Date on the originating system.

Return values from remote scripts are not limited to simple data types. Complex arrays or data-only objects can also be returned, allowing remote execution to transfer large amounts of date between servers. The only limitation is that the data structures must not contain any circular references.

The command has the following syntax:

get-remoteResult remoteTarget

The funclet returns a polymorphic value from the remote execution process. If the execution has not finished, the return value is of type undefined. If another error occurs, an exception is created.

remoteTarget

Specifies the name of the remote target system.

Example

Get serialized representation and actual value of a remote execution:

rt = new RemoteTarget("ascli1", "bob", "ca123456");
run-remote "new Date()" on rt -wait
? rt.result()            // XML string
v = get-remoteResult(rt) // Calls result() internally
? v
? typeName(v)            // Date

See also:

RemoteTarget Class

RemoteTarget.output Method

RemoteTarget.result Method