3.1.5.1 General Rules

The PowerShell Remoting Protocol MUST adhere to the message processing rules specified in [MS-WSMV] section 3.1.4.1.31, in addition to the following.

  1. The client uses wxf:Send (section 3.1.5.3.5), wxf:Create (section 3.1.5.3.3), and wxf:Command (section 3.1.5.3.3) messages to send PowerShell Remoting Protocol data to a server's RunspacePool or pipeline. The client MUST follow the rules described in section 3.1.5.1.1 while sending messages.

  2. The client receives data from the server as part of wxf:ReceiveResponse (section 3.2.5.3.8) message and constructs a PSRP message according to the rules described in section 3.1.5.2. The client decides whether a PSRP message is targeted to a RunspacePool or pipeline according to the rules described in sections 3.1.5.4 and 2.2.1.

  3. Some messages apply only to RunspacePools, and are valid only when the RunspacePool is in certain states. The valid states for each message are listed in section 3.1.5.4. When a client receives a message for a RunspacePool that is not in the correct state, the client MUST stop any executing pipelines (section 3.1.1.3.2) and close that RunspacePool (section 3.1.1.2.2).

  4. Some messages apply to pipelines, and are valid only when the pipeline is in certain states. The valid states for each message are listed in section 3.1.5.4. When a client receives a message for a pipeline that is not in the correct state, then the client MUST stop the pipelines (section 3.1.1.3.2).

  5. When a client's RunspacePool state reaches Closed or Broken state, the client MUST NOT process any message targeted for that particular RunspacePool and MUST NOT send any messages to the server's RunspacePool, except for wxf:Delete message (section 3.1.5.3.11). If the client receives any message from the server targeted to the RunspacePool in this state, the client MUST ignore that message.

  6. When a client's pipeline state reaches a Completed, Stopped, or Failed state, the client MUST NOT process any message targeted for that particular pipeline and MUST NOT send any messages to the server's pipeline, except for wxf:Signal message (section 3.1.5.3.9). If the client receives any message from the server targeted to the pipeline in this state, then the client MUST ignore that message.