def each_instance( namespace_or_objectpath, classname = nil )
    op = if namespace_or_objectpath.is_a? Openwsman::ObjectPath
      namespace_or_objectpath
    else
      objectpath namespace_or_objectpath, classname
    end
    @options.flags = Openwsman::FLAG_ENUMERATION_OPTIMIZATION
    @options.max_elements = 999
    uri = epr_uri_for op.namespace, op.classname
    result = @client.enumerate( @options, nil, uri )
    loop do
      if _handle_fault @client, result
        break
      end
      items = result.Items rescue nil
      if items
        items.each do |inst|
          yield Wbem::Instance.new(self, uri, inst)
        end
      end
      context = result.context
      break unless context
      result = @client.pull( @options, nil, uri, context )
    end
  end
def each_instance( namespace_or_objectpath, classname = nil )
    op = if namespace_or_objectpath.is_a? Openwsman::ObjectPath
      namespace_or_objectpath
    else
      objectpath namespace_or_objectpath, classname
    end
    @options.flags = Openwsman::FLAG_ENUMERATION_OPTIMIZATION
    @options.max_elements = 999
    uri = epr_uri_for op.namespace, op.classname
    result = @client.enumerate( @options, nil, uri )
    loop do
      if _handle_fault @client, result
        break
      end
      items = result.Items rescue nil
      if items
        items.each do |inst|
          yield Wbem::Instance.new(self, uri, inst)
        end
      end
      context = result.context
      break unless context
      result = @client.pull( @options, nil, uri, context )
    end
  end
Enumerate instances