For instances were I want to have a more persisted state I would create a Sandbox file (with file extension .wsb) which just runs a setup script when the environment starts.
So basically what you would do with a provisioning script when using VM's.
You can find more about it here: https://learn.microsoft.com/en-us/windows/security/threat-pr...