// NewVMSwitchManager returns a new Manager type
NewVMSwitchManager returns a new Manager type
// NewVMSwitchManager returns a new Manager type
func NewVMSwitchManager() (*Manager, error) {
	w, err := wmi.NewConnection(".", `root\virtualization\v2`)
	if err != nil {
		return nil, err
	}
	svc, err := w.GetOne(VMSwitchManagementService, []string{}, []wmi.Query{})
	if err != nil {
		return nil, err
	}
	standardCim, err := wmi.NewConnection(".", `root\StandardCimv2`)
	if err != nil {
		return nil, err
	}
	sw := &Manager{
		con:         w,
		stdCimV2Con: standardCim,
		svc:         svc,
	}
	return sw, nil
}
func NewVMSwitchManager ( ) ( * Manager , error ) { w , err := wmi . NewConnection ( " " , `root\virtualization\v2` ) if err != nil { return nil , err } svc , err := w . GetOne ( VMSwitchManagementService , [ ] string { } , [ ] wmi . Query { } ) if err != nil { return nil , err } standardCim , err := wmi . NewConnection ( " " , `root\StandardCimv2` ) if err != nil { return nil , err } sw := & Manager { con : w , stdCimV2Con : standardCim , svc : svc , } return sw , nil }
NewVMSwitchManager returns a new Manager type
NewVMSwitchManager returns a new Manager type
// Get virtual machine management service