Young's modulus of porous silicon samples, with porosity ranging from 36% to 90%, is measured by the nanoindentation technique. The analysis of the nanoindentation data, including the specific problem linked with porous materials, is presented. The Young's modulus values Ep thus obtained appear to be drastically dependent on the porosity and on the doping level (p or p+ type). The dependence of Ep versus the relative density (for a series of p+ type samples) is quadratic, in good agreement with the model of Gibson and Ashby developed for cellular materials. This also shows that highly porous silicon layers exhibit very low Young's modulus (for a porosity of 90% it is about two orders of magnitude smaller than that of the nonporous material).