IP*Works! SSH V9 - Online Help
IP*Works! SSH V9
Questions / Feedback?

Execute Method

Execute a command on the remote PowerShell Server.

Syntax

procedure Execute(Command: String);

Remarks

The Command parameter contains the text of the command to execute. If the connection to the server hasn't been explicitly made before with the SSHLogon method, then the component will establish a new connection, execute the command and immediately close it. If a connection has been previously established, it will still be open when the command is done.

If the command returned any errors, an exception will be raised with the error information returned by the server.

Example: Executing a command and iterating over the results

Psclient1.Execute "ls C:\"

For i = 0 To Psclient1.PSObjectCount - 1
    Psclient1.PSObjectIndex = i
    For j = 0 To Psclient1.PSObjectPropertyCount - 1
        If Psclient1.PSObjectPropertyName(j) = "Name" Then
            Text1.Text = Text1.Text & Psclient1.PSObjectPropertyValue(j) & vbCrLf
        End If
    Next
Next

 
 
Copyright (c) 2017 /n software inc. - All rights reserved.
Build 9.0.6240.0