We examine the switching dynamics of a stochastic population subjected to a deterministically time-varying environment. Our approach is demonstrated in the realm of ecology on a problem of population establishment. Here, by assuming a constant immigration pressure along with a strong Allee effect, at the deterministic level one obtains a critical population size beyond which the system experiences establishment. Notably the latter has been shown to be strongly influenced by the interplay between demographic and environmental noise. We consider two prototypical examples for environmental variations: a temporary environmental change, and a periodically-varying environment. By employing a semi-classical approximation we compute, within exponential accuracy, the change in the establishment probability and mean establishment time of the population, due to the environmental variability. Our analytical results are verified by using a modified Gillespie algorithm which accounts for explicitly time-dependent reaction rates. Finally, our theoretical approach can also be useful in studying switching dynamics in gene regulatory networks under extrinsic variations.