(self, protocol_version="2.3", **kwargs)
[MS-PSRP] 2.2.3.12 Command
        https://msdn.microsoft.com/en-us/library/dd339976.aspx

        :param protocol_version: The negotiated protocol version of the remote
            host. This determines what merge_* objects are added to the
            serialized xml.
        :param cmd: The cmdlet or script to run
        :param is_script: Whether cmd is a script or not
        :param use_local_scope: Use local or global scope to invoke commands
        :param merge_my_result: Controls the behaviour of what stream to merge
            to 'merge_to_result'. Only supports NONE or ERROR (only used in
            protocol 2.1)
        :param merge_to_result: Controls the behaviour of where to merge the
            'merge_my_result' stream. Only supports NONE or OUTPUT (only used
            in protocol 2.1)
        :param merge_previous: Controls the behaviour of where to merge the
            previous Output and Error streams that have been unclaimed
        :param merge_error: The merge behaviour of the Error stream
        :param merge_warning: The merge behaviour of the Warning stream
        :param merge_verbose: The merge behaviour of the Verbose stream
        :param merge_debug: The merge behaviour of the Debug stream
        :param merge_information: The merge behaviour of the Information stream
        :param args: List of CommandParameters for the cmdlet being invoked
        :param end_of_statement: Whether this command is the last in the
            current statement
[MS-PSRP] 2.2.3.12 Command
        https://msdn.microsoft.com/en-us/library/dd339976.aspx
[ MS - PSRP ] 2 . 2 . 3 . 12 Command https : // msdn . microsoft . com / en - us / library / dd339976 . aspx
def __init__(self, protocol_version="2.3", **kwargs):
        """
        [MS-PSRP] 2.2.3.12 Command
        https://msdn.microsoft.com/en-us/library/dd339976.aspx

        :param protocol_version: The negotiated protocol version of the remote
            host. This determines what merge_* objects are added to the
            serialized xml.
        :param cmd: The cmdlet or script to run
        :param is_script: Whether cmd is a script or not
        :param use_local_scope: Use local or global scope to invoke commands
        :param merge_my_result: Controls the behaviour of what stream to merge
            to 'merge_to_result'. Only supports NONE or ERROR (only used in
            protocol 2.1)
        :param merge_to_result: Controls the behaviour of where to merge the
            'merge_my_result' stream. Only supports NONE or OUTPUT (only used
            in protocol 2.1)
        :param merge_previous: Controls the behaviour of where to merge the
            previous Output and Error streams that have been unclaimed
        :param merge_error: The merge behaviour of the Error stream
        :param merge_warning: The merge behaviour of the Warning stream
        :param merge_verbose: The merge behaviour of the Verbose stream
        :param merge_debug: The merge behaviour of the Debug stream
        :param merge_information: The merge behaviour of the Information stream
        :param args: List of CommandParameters for the cmdlet being invoked
        :param end_of_statement: Whether this command is the last in the
            current statement
        """
        super(Command, self).__init__()
        arg_types = [
            "System.Collections.Generic.List`1[["
            "System.Management.Automation.PSObject, "
            "System.Management.Automation, "
            "Version=1.0.0.0, Culture=neutral, "
            "PublicKeyToken=31bf3856ad364e35]]",
            "System.Object",
        ]
        extended_properties = [
            ('cmd', ObjectMeta("S", name="Cmd")),
            ('is_script', ObjectMeta("B", name="IsScript")),
            ('use_local_scope', ObjectMeta("B", name="UseLocalScope")),
            ('merge_my_result', ObjectMeta("Obj", name="MergeMyResult",
                                           object=PipelineResultTypes)),
            ('merge_to_result', ObjectMeta("Obj", name="MergeToResult",
                                           object=PipelineResultTypes)),
            ('merge_previous', ObjectMeta("Obj", name="MergePreviousResults",
                                          object=PipelineResultTypes)),
            ('args', ListMeta(
                name="Args",
                list_value_meta=ObjectMeta(object=CommandParameter),
                list_types=arg_types)
             ),
        ]

        if version_equal_or_newer(protocol_version, "2.2"):
            extended_properties.extend([
                ('merge_error', ObjectMeta("Obj", name="MergeError",
                                           object=PipelineResultTypes,
                                           optional=True)),
                ('merge_warning', ObjectMeta("Obj", name="MergeWarning",
                                             object=PipelineResultTypes,
                                             optional=True)),
                ('merge_verbose', ObjectMeta("Obj", name="MergeVerbose",
                                             object=PipelineResultTypes,
                                             optional=True)),
                ('merge_debug', ObjectMeta("Obj", name="MergeDebug",
                                           object=PipelineResultTypes,
                                           optional=True)),
            ])

        if version_equal_or_newer(protocol_version, "2.3"):
            extended_properties.extend([
                ('merge_information', ObjectMeta(
                    "Obj", name="MergeInformation",
                    object=PipelineResultTypes,
                    optional=True
                )),
            ])
        self._extended_properties = extended_properties

        self.protocol_version = protocol_version
        self.cmd = kwargs.get("cmd")
        self.is_script = kwargs.get("is_script")
        self.use_local_scope = kwargs.get("use_local_scope")

        none_merge = PipelineResultTypes(value=PipelineResultTypes.NONE)

        # valid in all protocols, only really used in 2.1 (PowerShell 2.0)
        self.merge_my_result = kwargs.get("merge_my_result", none_merge)
        self.merge_to_result = kwargs.get("merge_to_result", none_merge)

        self.merge_previous = kwargs.get("merge_previous", none_merge)

        # only valid for 2.2+ (PowerShell 3.0+)
        self.merge_error = kwargs.get("merge_error", none_merge)
        self.merge_warning = kwargs.get("merge_warning", none_merge)
        self.merge_verbose = kwargs.get("merge_verbose", none_merge)
        self.merge_debug = kwargs.get("merge_debug", none_merge)

        # only valid for 2.3+ (PowerShell 5.0+)
        self.merge_information = kwargs.get("merge_information", none_merge)

        self.args = kwargs.get("args", [])

        # not used in the serialized message but controls how Pipeline is
        # packed (Cmds/ExtraCmds)
        self.end_of_statement = kwargs.get("end_of_statement", False)
def __init__ ( self , protocol_version = "2.3" , * * kwargs ) : super ( Command , self ) . __init__ ( ) arg_types = [ "System.Collections.Generic.List`1[[" "System.Management.Automation.PSObject, " "System.Management.Automation, " "Version=1.0.0.0, Culture=neutral, " "PublicKeyToken=31bf3856ad364e35]]" , "System.Object" , ] extended_properties = [ ( 'cmd' , ObjectMeta ( "S" , name = "Cmd" ) ) , ( 'is_script' , ObjectMeta ( "B" , name = "IsScript" ) ) , ( 'use_local_scope' , ObjectMeta ( "B" , name = "UseLocalScope" ) ) , ( 'merge_my_result' , ObjectMeta ( "Obj" , name = "MergeMyResult" , object = PipelineResultTypes ) ) , ( 'merge_to_result' , ObjectMeta ( "Obj" , name = "MergeToResult" , object = PipelineResultTypes ) ) , ( 'merge_previous' , ObjectMeta ( "Obj" , name = "MergePreviousResults" , object = PipelineResultTypes ) ) , ( 'args' , ListMeta ( name = "Args" , list_value_meta = ObjectMeta ( object = CommandParameter ) , list_types = arg_types ) ) , ] if version_equal_or_newer ( protocol_version , "2.2" ) : extended_properties . extend ( [ ( 'merge_error' , ObjectMeta ( "Obj" , name = "MergeError" , object = PipelineResultTypes , optional = True ) ) , ( 'merge_warning' , ObjectMeta ( "Obj" , name = "MergeWarning" , object = PipelineResultTypes , optional = True ) ) , ( 'merge_verbose' , ObjectMeta ( "Obj" , name = "MergeVerbose" , object = PipelineResultTypes , optional = True ) ) , ( 'merge_debug' , ObjectMeta ( "Obj" , name = "MergeDebug" , object = PipelineResultTypes , optional = True ) ) , ] ) if version_equal_or_newer ( protocol_version , "2.3" ) : extended_properties . extend ( [ ( 'merge_information' , ObjectMeta ( "Obj" , name = "MergeInformation" , object = PipelineResultTypes , optional = True ) ) , ] ) self . _extended_properties = extended_properties self . protocol_version = protocol_version self . cmd = kwargs . get ( "cmd" ) self . is_script = kwargs . get ( "is_script" ) self . use_local_scope = kwargs . get ( "use_local_scope" ) none_merge = PipelineResultTypes ( value = PipelineResultTypes . NONE ) # valid in all protocols, only really used in 2.1 (PowerShell 2.0) self . merge_my_result = kwargs . get ( "merge_my_result" , none_merge ) self . merge_to_result = kwargs . get ( "merge_to_result" , none_merge ) self . merge_previous = kwargs . get ( "merge_previous" , none_merge ) # only valid for 2.2+ (PowerShell 3.0+) self . merge_error = kwargs . get ( "merge_error" , none_merge ) self . merge_warning = kwargs . get ( "merge_warning" , none_merge ) self . merge_verbose = kwargs . get ( "merge_verbose" , none_merge ) self . merge_debug = kwargs . get ( "merge_debug" , none_merge ) # only valid for 2.3+ (PowerShell 5.0+) self . merge_information = kwargs . get ( "merge_information" , none_merge ) self . args = kwargs . get ( "args" , [ ] ) # not used in the serialized message but controls how Pipeline is # packed (Cmds/ExtraCmds) self . end_of_statement = kwargs . get ( "end_of_statement" , False )