// GetOne returns the first result from a query response.
GetOne returns the first result from a query response.
// GetOne returns the first result from a query response .
func (w *WMI) GetOne(resource string, fields []string, qParams []Query) (*Result, error) {
	res, err := w.Gwmi(resource, fields, qParams)
	if err != nil {
		return nil, err
	}
	c, err := res.Count()
	if err != nil {
		return nil, err
	}
	if c == 0 {
		return nil, ErrNotFound
	}
	item, err := res.ItemAtIndex(0)
	if err != nil {
		return nil, err
	}
	return item, nil
}
func ( w * WMI ) GetOne ( resource string , fields [ ] string , qParams [ ] Query ) ( * Result , error ) { res , err := w . Gwmi ( resource , fields , qParams ) if err != nil { return nil , err } c , err := res . Count ( ) if err != nil { return nil , err } if c == 0 { return nil , ErrNotFound } item , err := res . ItemAtIndex ( 0 ) if err != nil { return nil , err } return item , nil }
GetOne returns the first result from a query response.
GetOne returns the first result from a query response .