WSManReceiveShellOutput function

Retrieves output from a running command or from the shell.

Syntax

void WSManReceiveShellOutput(
  WSMAN_SHELL_HANDLE     shell,
  WSMAN_COMMAND_HANDLE   command,
  DWORD                  flags,
  WSMAN_STREAM_ID_SET    *desiredStreamSet,
  WSMAN_SHELL_ASYNC      *async,
  WSMAN_OPERATION_HANDLE *receiveOperation
);

Parameters

shell

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

command

Specifies the command handle returned by a WSManRunShellCommand call.

flags

Reserved for future use. Must be set to zero.

desiredStreamSet

Specifies the requested output from a particular stream or a list of streams.

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 WSManCloseOperation method.

receiveOperation

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

Return Value

This function does not return a value.

Requirements

   
Windows version Windows 7 Windows Server 2008 R2
Target Platform Windows
Header wsman.h
Library WsmSvc.lib
DLL WsmSvc.dll