WSManSendShellInput function (wsman.h)

Pipes the input stream to a running command or to the shell.

Syntax

void WSManSendShellInput(
  [in]           WSMAN_SHELL_HANDLE     shell,
  [in, optional] WSMAN_COMMAND_HANDLE   command,
                 DWORD                  flags,
  [in]           PCWSTR                 streamId,
  [in]           WSMAN_DATA             *streamData,
                 BOOL                   endOfStream,
  [in]           WSMAN_SHELL_ASYNC      *async,
  [out]          WSMAN_OPERATION_HANDLE *sendOperation
);

Parameters

[in] shell

Specifies the shell handle returned by a WSManCreateShell call. This parameter cannot be NULL.

[in, optional] command

Specifies the command handle returned by a WSManRunShellCommand call. This handle should be closed by calling the WSManCloseCommand method.

flags

Reserved for future use. Must be set to zero.

[in] streamId

Specifies the input stream ID. This parameter cannot be NULL.

[in] streamData

Uses the WSMAN_DATA structure to specify the stream data to be sent to the command or shell. This structure should be allocated by the calling client and must remain allocated until WSManSendShellInput completes. If the end of the stream has been reached, the endOfStream parameter should be set to TRUE.

endOfStream

Set to TRUE, if the end of the stream has been reached. Otherwise, this parameter is set to FALSE.

[in] async

Defines an asynchronous structure. The asynchronous structure contains an optional user context and a mandatory callback function. See the WSMAN_SHELL_ASYNC structure for more information. This parameter cannot be NULL and should be closed by calling the WSManCloseCommand method.

[out] sendOperation

Defines the operation handle for the send operation. This handle is returned from a successful call of the function and can be used to asynchronously cancel the send operation. This handle should be closed by calling the WSManCloseOperation method. This parameter cannot be NULL.

Return value

None

Requirements

Requirement Value
Minimum supported client Windows 7
Minimum supported server Windows Server 2008 R2
Target Platform Windows
Header wsman.h
Library WsmSvc.lib
DLL WsmSvc.dll
Redistributable Windows Management Framework on Windows Server 2008 with SP2, Windows Vista with SP1, and Windows Vista with SP2