This work demonstrates an all-fiber, gain-switched Tm<sup>3+</sup>-doped fiber laser operating at 1706nm. The laser is based on a compact 40-cm Fabry-Pérot cavity using a 7-cm Tm<sup>3+</sup>-doped fiber and fiber Bragg gratings. The Tm<sup>3+</sup>-doped fiber laser cavity was pumped by a directly modulated 1560-nm DFB laser diode. The 1560-nm pump laser was amplified through multistage EDFA and EYDFA, which enabled gain switching with a pump threshold of 1.2W and a slope efficiency of 27%. The 1.7μm output achieves a narrow 3dB bandwidth of 0.12nm and high spectral SNR (>48dB). The feasibility for biomedical applications was demonstrated through photoacoustic (PA) signal generation using polypropylene samples, which produced a peak-to-peak ultrasound signal of 5mV.