Laser-driven shock-waves are used as a surface treatement for compacting porous materials. The compaction depth is typically a few hundreds microns. The behavior of the porous medium is described through a compaction model based on the P-alpha theory of Herrmann. This model has been introduced into a one-dimensional finite difference hydrodynamic code describing the behavior of a target under the action of a laser-generated shock-wave. The code enables us to compute the compaction depth as a function of irradiation conditions, nature and initial porosity of the material. Experiments are performed on aluminum powder and sintered porous steel (Distaloy AE). The samples are covered with a transparent window acting as a confinement for the plasma generated by absorption of the incident radiation on the target surface. This process increases both the pressure and the duration of the applied pressure in comparison with a bare target irradiation. Samples are observed by optical microscopy. The residual porosity is estimated by image analysis. Experimental results and computed compaction profiles correlate well.