We develop a general approach for calculating the characteristic function of the work distribution of quantum many-body systems in a time-varying potential, whose many-body wave function can be cast in the Slater determinant form. Our results are applicable to a wide range of systems including an ideal gas of spinless fermions in one dimension (1D), the Tonks-Girardeau (TG) gas of hard-core bosons, as well as a 1D gas of hard-core anyons. In order to illustrate the utility of our approach, we focus on the TG gas confined to an arbitrary time-dependent trapping potential. In particular, we use the determinant representation of the many-body wave function to characterize the nonequilibrium thermodynamics of the TG gas and obtain exact and computationally tractable expressions---in terms of Fredholm determinants---for the mean work, the work probability distribution function, the nonadiabaticity parameter, and the Loschmidt amplitude. When applied to a harmonically trapped TG gas, our results for the mean work and the nonadiabaticity parameter reduce to those derived previously using an alternative approach. We next propose to use periodic modulation of the trap frequency in order to drive the system to highly non-equilibrium states by taking advantage of the phenomenon of parametric resonance. Under such driving protocol, the nonadiabaticity parameter may reach large values, which indicates a large amount of irreversible work being done on the system as compared to sudden quench protocols considered previously. This scenario is realizable in ultracold atom experiments, aiding fundamental understanding of all thermodynamic properties of the system.