2.2.2.14 GET_COMMAND_METADATA Message

The Data field of a PSRP message specifies a GET_COMMAND_METADATA message when the MessageType field has a value of 0x0002100A.

In messages of this type, the Data field is UTF-8 encoded XML, equivalent to the XML created by serializing a Complex Object (section 2.2.5.2) with the following extended properties (see section 2.2.5.2.9):

  • List of wildcard patterns specifying the command names that the server SHOULD return. If the value of this property is equal to NULL (see section 2.2.5.1.20), then it MUST be treated as if a List with a single "*" String was specified.

    • Property name: Name

    • Property type: List (see section 2.2.5.2.6.3) of Wildcards (see section 2.2.3.20). 

  • Command types.

    • Property name: CommandType

    • Property type: CommandType (see section 2.2.3.19).

  • Wildcard patterns describing the command namespaces containing the commands that the server SHOULD return. If the value of this property is NULL, it MUST be treated as if a List with a single empty String was specified.

    • Property name: Namespace

    • Property type: List (see section 2.2.5.2.6.3) of Wildcards (see section 2.2.3.20).

  • Extra arguments passed to the higher-layer above the PowerShell Remoting Protocol and not interpreted by the PowerShell Remoting Protocol.

    • Property name: ArgumentList

    • Property type: List (see section 2.2.5.2.6.3) of objects. For more details, see section 2.2.3.24.

The Complex Object described in this section SHOULD have no associated type names (section 2.2.5.2.3).

Example:

 <Obj RefId="0">
   <MS>
     <Obj N="Name" RefId="1">
       <TN RefId="0">
         <T>System.String[]</T>
         <T>System.Array</T>
         <T>System.Object</T>
       </TN>
       <LST>
         <S>Get-*</S>
       </LST>
     </Obj>
     <Obj N="CommandType" RefId="2">
       <TN RefId="1">
         <T>System.Management.Automation.CommandTypes</T>
         <T>System.Enum</T>
         <T>System.ValueType</T>
         <T>System.Object</T>
       </TN>
       <ToString>Alias, Function, Filter, Cmdlet</ToString>
       <I32>15</I32>
     </Obj>
     <Obj N="Namespace" RefId="3">
       <TNRef RefId="0" />
       <LST />
     </Obj>
     <Nil N="ArgumentList" />
   </MS>
 </Obj>