Enhancement and suppression of the formation of porous silicon