The 3d analyst / Functional Surface / Add surface information tool will take your polyline and add info from a surface.
One of the options is "Average slope". You can only add a surface statistic for each feature (like minZ, maxZ, slope etc.) If you need finer control you would probably have to dump the line vertices out to points then add the surface information to that.
Good luck,
Neil