A fast-switching, high-repetition-rate magnet and power supply have been developed for and operated at TRIUMF, to deliver a proton beam to the new ultracold neutron (UCN) facility. The facility possesses unique operational requirements: a time-averaged beam current of 40~$mu$A with the ability to switch the beam on or off for several minutes. These requirements are in conflict with the typical operation mode of the TRIUMF cyclotron which delivers nearly continuous beam to multiple users. To enable the creation of the UCN facility, a beam-sharing arrangement with another facility was made. The beam sharing is accomplished by the fast-switching (kicker) magnet which is ramped in 50~$mu$s to a current of 193~A, held there for approximately 1~ms, then ramped down in the same short period of time. This achieves a 12~mrad deflection which is sufficient to switch the proton beam between the two facilities. The kicker magnet relies on a high-current, low-inductance coil connected to a fast-switching power supply that is based on insulated-gate bipolar transistors (IGBTs). The design and performance of the kicker magnet system and initial beam delivery results are reported.