Restore Windows 10 / Windows Server 2016 to clean state easily

Some programs that we have are installed on Windows 10 machines, while others are running on Windows Server 2016. To have an easy way of testing our installers, I would like to be able to restore the state of the machine to how it was before running the installers. As some of the installers might install 3rd party drivers, only uninstalling our software would not be enough. Keeping track of and uninstalling all 3rd party drivers will probably be hard to do as well.

Is there a way of saving a version of Windows and then to easily restore that version?