The production of $K^+$ mesons in proton-nucleus collisions from 1.0 to 2.5 GeV is analyzed with respect to one-step nucleon-nucleon $(NNto N Y K^+$) and two-step $Delta$-nucleon $(Delta N to K^+ Y N$) or pion-nucleon $(pi N to K^+ Y $) production channels on the basis of a coupled-channel transport approach (CBUU) including the kaon final state interactions. The influence of momentum-dependent potentials for the nucleon, hyperon and kaon in the final state are studied as well as the importance of $K^+$ elastic rescattering in the target nucleus. The transport calculations are compared to the experimental $K^+$ spectra taken at LBL Berkeley, SATURNE, CELSIUS, GSI and COSY-Julich. It is found that the momentum-dependent baryon potentials effect the excitation function of the $K^+$ cross section; at low bombarding energies of $sim $ 1.0 GeV the attractive baryon potentials in the final state lead to a relative enhancement of the kaon yield whereas the net repulsive potential at bombarding energies $sim$ 2 GeV causes a decrease of the $K^+$ cross section. Furthermore it is pointed out, that especially the $K^+$ spectra at low momenta (or kinetic energy $T_K$) allow to determine the in-medium $K^+$ potential almost model independently due to a relative shift of the $K^+$ spectra in kinetic energy that arises from the acceleration of the kaons when propagating out of the nuclear medium to free space, i.e. converting potential energy to kinetic energy of the free kaon.