Hi,
I'm Mouad, an independent advisor, and I'm glad to be able to help you.
Sorry that you face this constraint, but unfortunately there is no way to automate the factory reset process, but If I understand your requirement you need to make the PC intact from any changes or commands being executed, thus you keep it in the same state at need, there is some good softwares to do so, like Deep Freeze and Shadow Defender.
from my part I'll take a look if there is any powershell api that help to keep the same state in conjunction with DSC "Desired state configuration" for example.
Best regards,
Mouad.