// Gwmi makes a WMI query and returns a *Result
Gwmi makes a WMI query and returns a *Result
// Gwmi makes a WMI query and returns a * Result
func (w *WMI) Gwmi(resource string, fields []string, qParams []Query) (*Result, error) {
	n := "*"
	if len(fields) > 0 {
		n = strings.Join(fields, ",")
	}
	qStr, err := w.getQueryParams(qParams)
	if err != nil {
		return nil, err
	}
	q := fmt.Sprintf("SELECT %s FROM %s %s", n, resource, qStr)
	resultRaw, err := oleutil.CallMethod(w.wmi, "ExecQuery", q)
	if err != nil {
		return nil, err
	}
	wmiRes := &Result{
		rawRes: resultRaw,
	}
	return wmiRes, nil
}
func ( w * WMI ) Gwmi ( resource string , fields [ ] string , qParams [ ] Query ) ( * Result , error ) { n := " " if len ( fields ) > 0 { n = strings . Join ( fields , " " ) } qStr , err := w . getQueryParams ( qParams ) if err != nil { return nil , err } q := fmt . Sprintf ( " " , n , resource , qStr ) resultRaw , err := oleutil . CallMethod ( w . wmi , " " , q ) if err != nil { return nil , err } wmiRes := & Result { rawRes : resultRaw , } return wmiRes , nil }
Gwmi makes a WMI query and returns a *Result
Gwmi makes a WMI query and returns a * Result
// result is a SWBemObjectSet // fmt.Println(q)