The components of the tensors ff' 1 ', and %( 2 >, which describe the linear and quadratic electric-field dependences of the nuclear magnetic shielding and susceptibility are computed for H2 and HF molecules using a gauge invariant double finite perturbation SCF approach. This approach is suitable for the discussion of intramolecular and intermolecular environmental effects and the effect of electric-field gradient is pointed out.