Method of discharging capacitors in compensation cabinets