Previous Topic: OSRedirect.errout MethodNext Topic: OSRedirect.onCompleted Method


OSRedirect.hasCompleted Method

This method checks if the execution of a remote command has completed. If run-remote is invoked without the optional -wait switch, the execution runs asynchronously. Call this method to verify if a command completes and a result is available. The method hasCompleted() returns true when the command successfully completes, or false when an error occurs that prevents further processing.

This method has the following syntax:

hasCompleted()

The method returns the following values:

true

Indicates if the command processing has been completed.

false

Indicates if the command processing has not been completed, for example, host not found.

Example

!! dir c:\*.* /s
? $$stdout.hasCompleted()    // true

See also:

! Command--Invoke Command or Child Process (Cmdlet)

!! Command--Invoke Command or Child Process and Auto-capture Output (Cmdlet)