// SetName renames the switch.
SetName renames the switch.
// SetName renames the switch .
func (v VirtualSwitch) SetName(newName string) error {
	switchSettingsResult, err := v.virtualSwitch.Get("associators_", nil, VMSwitchSettings)
	if err != nil {
		return errors.Wrap(err, "associators_")
	}
	result, err := switchSettingsResult.ItemAtIndex(0)
	if err != nil {
		return errors.Wrap(err, "ItemAtIndex")
	}
	if err := result.Set("ElementName", newName); err != nil {
		return errors.Wrap(err, "ElementName")
	}
	text, err := result.GetText(1)
	if err != nil {
		return errors.Wrap(err, "GetText")
	}
	if err := v.modifySwitchSettings(text); err != nil {
		return errors.Wrap(err, "modifySwitchSettings")
	}
	if err := v.setInternalPortName(newName); err != nil {
		return errors.Wrap(err, "setInternalPortName")
	}
	return nil
}
func ( v VirtualSwitch ) SetName ( newName string ) error { switchSettingsResult , err := v . virtualSwitch . Get ( " " , nil , VMSwitchSettings ) if err != nil { return errors . Wrap ( err , " " ) } result , err := switchSettingsResult . ItemAtIndex ( 0 ) if err != nil { return errors . Wrap ( err , " " ) } if err := result . Set ( " " , newName ) ; err != nil { return errors . Wrap ( err , " " ) } text , err := result . GetText ( 1 ) if err != nil { return errors . Wrap ( err , " " ) } if err := v . modifySwitchSettings ( text ) ; err != nil { return errors . Wrap ( err , " " ) } if err := v . setInternalPortName ( newName ) ; err != nil { return errors . Wrap ( err , " " ) } return nil }
SetName renames the switch.
SetName renames the switch .
// Get fresh settings info