(self, executable, arguments, no_shell=False, command_id=None)
return self.wsman.command(self.resource_uri, cmd, option_set=options,
                                  selector_set=self._selector_set)
Send a command message to the Shell. Process should really be used
        instead if a normal WinRS process is desired.

        :param executable: The path to the command/executable
        :param arguments: A list of arguments to run with the executable
        :param no_shell: Whether to create the command in the cmd shell or
            bypass it. If True then executable must be the full path to the
            exe. This only works on older OS's before 2012 R2 (not including)
        :param command_id: The command ID to specify when creating the command
        :return: The raw WSMan body response
Send a command message to the Shell. Process should really be used
        instead if a normal WinRS process is desired.
Send a command message to the Shell . Process should really be used instead if a normal WinRS process is desired .
def command(self, executable, arguments, no_shell=False, command_id=None):
        """
        Send a command message to the Shell. Process should really be used
        instead if a normal WinRS process is desired.

        :param executable: The path to the command/executable
        :param arguments: A list of arguments to run with the executable
        :param no_shell: Whether to create the command in the cmd shell or
            bypass it. If True then executable must be the full path to the
            exe. This only works on older OS's before 2012 R2 (not including)
        :param command_id: The command ID to specify when creating the command
        :return: The raw WSMan body response
        """
        rsp = NAMESPACES['rsp']

        options = OptionSet()
        options.add_option('WINRS_SKIP_CMD_SHELL', no_shell)

        arguments = arguments if arguments is not None else []

        cmd = ET.Element("{%s}CommandLine" % rsp)
        if command_id is not None:
            cmd.attrib['CommandId'] = command_id

        ET.SubElement(cmd, "{%s}Command" % rsp).text = executable
        for argument in arguments:
            ET.SubElement(cmd, "{%s}Arguments" % rsp).text = argument

        return self.wsman.command(self.resource_uri, cmd, option_set=options,
                                  selector_set=self._selector_set)
def command ( self , executable , arguments , no_shell = False , command_id = None ) : rsp = NAMESPACES [ 'rsp' ] options = OptionSet ( ) options . add_option ( 'WINRS_SKIP_CMD_SHELL' , no_shell ) arguments = arguments if arguments is not None else [ ] cmd = ET . Element ( "{%s}CommandLine" % rsp ) if command_id is not None : cmd . attrib [ 'CommandId' ] = command_id ET . SubElement ( cmd , "{%s}Command" % rsp ) . text = executable for argument in arguments : ET . SubElement ( cmd , "{%s}Arguments" % rsp ) . text = argument return self . wsman . command ( self . resource_uri , cmd , option_set = options , selector_set = self . _selector_set )