In this paper, we consider discounted penalty functions, also called Gerber-Shiu functions, in a Markovian shot-noise environment. At first, we exploit the underlying structure of piecewise-deterministic Markov processes (PDMPs) to show that these penalty functions solve certain partial integro-differential equations (PIDEs). Since these equations cannot be solved exactly, we develop a numerical scheme that allows us to determine an approximation of such functions. These numerical solutions can be identified with penalty functions of continuous-time Markov chains with finite state space. Finally, we show the convergence of the corresponding generators over suitable sets of functions to prove that these Markov chains converge weakly against the original PDMP. That gives us that the numerical approximations converge to the discounted penalty functions of the original Markovian shot-noise environment.