Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

WSManReceiveShellOutput function

Retrieves output from a running command or from the shell.


void WINAPI WSManReceiveShellOutput(
  _Inout_   HANDLE shell,
  _In_opt_  HANDLE command,
  DWORD flags,
  _In_opt_  WSMAN_STREAM_ID_SET *desiredStreamSet,
  _In_      WSMAN_SHELL_ASYNC *async,
  _Out_     HANDLE *receiveOperation


shell [in, out]

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

command [in, optional]

Specifies the command handle returned by a WSManRunShellCommand call.


Reserved for future use. Must be set to zero.

desiredStreamSet [in, optional]

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

async [in]

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 [out]

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.


Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

Windows Server 2008 R2 [desktop apps only]


Windows Management Framework on Windows Server 2008 with SP2, Windows Server 2003 with SP2, Windows Vista with SP1, Windows Vista with SP2, and Windows XP with SP3









Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.