A finite element model of directed energy deposition (DED) process predicts the thermal history during the manufacturing of high speed steel cuboid samples. The simulation result validation relies on comparisons between measured and predicted data such as temperature histories within the substrate and the melt pool depth of the last coating layer. Integrated within an optimization loop, these DED simulations identify two variable laser power functions able to generate a constant melt pool size. These functions are expected to provide a homogeneous microstructure over layers. The computed thermal fields and the microstructure generated by three AISI M4 experiments performed with the constant laser power case and the two optimized functions at three points of interest located at different depths within the deposit are correlated. The effect of the melt superheating temperature and the thermal cyclic history on micro and nanohardness measurements is observed. As a result, the optimized laser power functions provide samples with more homogeneous microhardness than the constant laser power function, however, the homogeneity of microstructure is not fully confirmed by the nanohardness map throughout the deposited M4 steel layers.