3.1.5.3.1 Rules for the wxf:Create Message

The client uses a wxf:Create message (as described in [MS-WSMV] section 3.1.4.5.2) to create a RunspacePool on the server. Before sending this message, the client creates a RunspacePool instance, assigns it a GUID (section 2.2.5.1.18), and initializes its state to Opening (section 3.1.1.2.2). The following information is supplied for the wxf:Create message.

 Element

 Value

Uri

Network URI to which to connect.

ResourceURI

Any string, according to the rules specified in [MS-WSMV] section 3.1.4.5.2.<3>

OptionSet

An option set with the following options.

Name = ProtocolVersion, MustComply=True, Value=2.1 or 2.2

The following information is supplied for the shell data type, as required by [MS-WSMV] section 2.2.4.37, in the wxf:Create message.

 Element

Value

ShellId

Valid PSRP connection string of the form.Proto://computername:port/applicationname

Where "proto" can be "http" or "https", "computername" is the name of the machine to which to connect, "port" is the port for connection, and "applicationname" can be WSMAN or any other application that supports WSMV.<4>

IdleTimeout

The client can specify any integer value. <5>

InputStreams

"stdin pr".

"stdin" is used to send regular data. "pr" is used to send host response data (see sections 2.2.2.28 and 2.2.2.16).

OutputStreams

stdout

WorkingDirectory

Unused by the PowerShell Remoting Protocol.

Lifetime

Unused by the PowerShell Remoting Protocol.

Environment

Unused by the PowerShell Remoting Protocol.

<open content>

<creationXml> is described in the following section.

The generic description for <open content> is defined in [MS-WSMV] section 2.2.4.37.

The client uses <open content> to send additional data, called creationXml data, that assists in creating a shell on the server. This creationXml can contain any data that is destined to the shell. Without this creationXml data, clients MUST use wxf:Send messages, described in section 3.1.5.3.5. To avoid multiple network calls, it is encouraged to send additionally using "creationXml". A SESSION_CAPABILITY message (section 2.2.2.1) MUST be the first message that is sent to a server from the client. Typically the SESSION_CAPABILITY message is broken down to only one fragment (see section 2.2.4), as is the INIT_RUNSPACEPOOL message, and both those messages are included in the creationXml. The creationXml MUST be of the following format.

 <creationXml xmlns=http://schemas.microsoft.com/powershell>
  Base64-Encoded data
 </creationXml>
  

As described in the preceding section, all the data that is sent as part of creationXml MUST be base64-encoded as described in [RFC3548].

If the wxf:Create message is successfully received and processed by the server, the server MUST send either a success or a failure message. In either case a response is sent from the server. A wxf:ResourceCreated message, described in [MS-WSMV] section 3.1.4.5.2, is sent to notify success. A wxf:Fault message, described in [MS-WSMV] section 2.2.4.43, is sent to notify failure.

Only the SESSION_CAPABILITY message (section 2.2.2.1) and INIT_RUNSPACEPOOL message (section 2.2.2.2) are sent using wxf:Create message. The client MUST NOT send any other PSRP messages using a wxf:Create message.