The production of W and Z bosons is one of the most prominent examples of hard scattering
processes at hadron colliders. The measurements of the corresponding inclusive and differential
cross sections provide important tests of perturbative quantum chromodynamics and parton dis-
tribution functions. Moreover, these processes constitute the main source of background for the
searches for dark matter or other exotic final states, making the precise knowledge of W and Z
boson kinematic spectra a fundamental tool to search for new physics. This paper reports a sum-
mary of the latest measurements of single electroweak boson production carried out by the CMS
experiment at the CERN Large Hadron Collider. They are based on data collected at a center-of-
mass energy of 8 or 13 TeV. The measurements are performed exploiting the decay of W and Z
bosons into electrons or muons, which provide a clean experimental final state with a low level
of background. Results are corrected to the stable-particle level through unfolding techniques
and compared with theoretical predictions obtained using several generators, allowing to validate
different models for the parton shower and hard scattering processes. The main features of the
selected analyses are illustrated and their role in the consolidation and development of our current
knowledge of the electroweak sector is highlighted. Finally, the prospects for new measurements
using the full dataset collected by CMS at 13 TeV by the end of 2018 are briefly discussed as well.